Thread Rating:
  • 10 Votes - 4.6 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 XThreads Example Applications
ralph522 Offline
Junior Member
**
Posts: 1
Joined: Feb 2015
Post: #42
RE: XThreads Example Applications
Hi guys, firstly i want to thank you for xthreads... huuge mod Smile

i looked for a suggestion with fancybox (highlighting images) but i dont know how i have to make changes in php file...

fancybox works great in threads but in forumdisplay not works... (new page with img after click on it).

fancyzoom.php

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php

/*
FancyZoom Plugin for MyBB
Copyright (C) 2009 Sebastian Wunderlich

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

if(!defined("IN_MYBB"))
{
	die();
}

$plugins->add_hook("pre_output_page","fancyzoom");

function fancyzoom_info()
{
	return array
	(
		"name"=>"FancyZoom",
		"description"=>"Open images and thumbnails with FancyZoom.",
		"website"=>"http://mods.mybboard.net/view/fancyzoom",
		"author"=>"Sebastian Wunderlich",
		"version"=>"1.2",
		"guid"=>"b67008c6447fe5f3b27ee7bcb8e1fc6e",
		"compatibility"=>"18*"
	);

}

function fancyzoom($page)
{
	global $mybb,$db;
	if(THIS_SCRIPT=="showthread.php")
	{
		$result=$db->simple_select("threads","fid","tid='".intval($mybb->input["tid"])."'",array("limit"=>1));
		$thread=$db->fetch_array($result);
		$permissions=forum_permissions($thread["fid"]);
		if(!empty($thread)&&$permissions["candlattachments"]==1)
		{
			$page=str_replace("</head>",'<script type="text/javascript" src="'.$mybb->settings["bburl"].'/jscripts/fancyzoom/FancyZoom.js"></script>
<script type="text/javascript" src="'.$mybb->settings["bburl"].'/jscripts/fancyzoom/FancyZoomHTML.js"></script>
</head>',$page);
			$page=preg_replace('/\<body(.*)\>/Usi','<body$1 onload="setupZoom()">',$page);
			$page=preg_replace('/\<a href="attachment.php\?aid=([0-9]+)" target="_blank"\>\<img/Usi','<a href="attachment.php?aid=$1" rel="fancyzoom"><img',$page);
			return $page;
		}
	}
}



?>


Anyone could help me? : )
Ps. sorry for my bad english, i hope u ll understand me Smile

02-01-2015 01:24 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
XThreads Example Applications - RateU - 11-07-2010, 02:50 AM
RE: XThreads Example Applications - RateU - 11-09-2010, 05:39 AM
RE: XThreads Example Applications - Imran - 11-12-2010, 11:36 PM
RE: XThreads Example Applications - RateU - 11-14-2010, 07:16 AM
RE: XThreads Example Applications - Imran - 11-14-2010, 02:48 PM
RE: XThreads Example Applications - duhol - 03-07-2011, 06:13 AM
RE: XThreads Example Applications - RateU - 03-21-2011, 08:05 AM
RE: XThreads Example Applications - RateU - 04-24-2012, 04:43 AM
RE: XThreads Example Applications - Sama34 - 04-24-2012, 02:04 PM
RE: XThreads Example Applications - RateU - 04-26-2012, 06:49 AM
RE: XThreads Example Applications - Sama34 - 04-26-2012, 01:13 PM
RE: XThreads Example Applications - RateU - 04-27-2012, 07:21 AM
RE: XThreads Example Applications - RateU - 08-03-2012, 07:37 AM
RE: XThreads Example Applications - RateU - 08-11-2012, 06:23 AM
RE: XThreads Example Applications - RateU - 08-12-2012, 05:04 AM
RE: XThreads Example Applications - Vapor - 08-04-2013, 04:25 AM
RE: XThreads Example Applications - kitarm - 12-10-2013, 08:40 PM
RE: XThreads Example Applications - ralph522 - 02-01-2015 01:24 AM
RE: XThreads Example Applications - XPMai - 06-14-2015, 01:52 AM

 Standard Tools
Forum Jump: