<? DEW-CODE.COM  
Dew-Code
Welcome, Guest
Please Login or Register.    Lost Password?
Thumbshots alternative (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Thumbshots alternative
#1051
IceMan (User)
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
Thumbshots alternative 1 Year ago Karma: 0  
Hi
Is it posible to alter the code so that the thumbshot is replaced with an image from my image folder?
Also is it posible to change the size of the thumbshot, either as the original "Thumbshot" image or the image from my image folders?

Kind Regards and thanks in advance

IceMan
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#1052
Dewed (Admin)
Admin
Posts: 534
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:Thumbshots alternative 1 Year ago Karma: 9  
The free thumbanil service from Thumsbhots.org is limited to 120 x 90 pixel images.

You can certainly change the code to use yoru own images..

The file you would need to edit is /include/functions.php (make a back up first, it is a rather large file)

The draw_sites function, responsible to displaying the entries starts around line # 1175
The code that creates the IMG SRC tag is around line # 1235 and looks like this ...

Code:

if ($thumbshot == "1"){$htmlsrc .="height=\"90\"> <td valign=\"top\" width=\"120\" class=\"" . $cell_color . "\" background=./images/na.gif> <a target=\"blank\" href=./out.php?ID=" . $sites_array[site_id] . ">"; $htmlsrc .="<img border=\"0\" align=\"top\" src=http://open.thumbshots.org/image.pxf?url=". urlencode($sites_array["site_url"]) ."></a></td><td valign=\"top\" class=\"" . $cell_color . "\">";
So you could create an image for each entry, name the file for the Site ID of the entry, like entry #5 gets 5.gif or 5.jpg You could put them in a directory, like "sitepics".. Then, replace this code
Code:

$htmlsrc .="<img border=\"0\" align=\"top\" src=http://open.thumbshots.org/image.pxf?url=". urlencode($sites_array["site_url"]) ."></a>
With something like
Code:

$htmlsrc .="<img border=\"0\" align=\"top\" src=\"/sitepics/".$sites_array["site_id"] .".jpg\"></a>
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#1053
IceMan (User)
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
Re:Thumbshots alternative 1 Year ago Karma: 0  
Worked like a dream
I am having trouble finding the (_blank) that is making the links open in a new window when i want them to open in the same window (_top) ....a pointer ? I have tried....honestly

IceMan
 
Report to moderator   Logged Logged  
 
Last Edit: 2009/08/22 16:53 By IceMan.
  The administrator has disabled public write access.
#1054
Dewed (Admin)
Admin
Posts: 534
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:Thumbshots alternative 1 Year ago Karma: 9  
I made a booboo .. You are right it should be _blank to cause a link to open a new window, but apparently just "blank" works as well

Above and below the area you just edited you'll find where the target=blank is added to the href, probably the easiest way to change that behavior is to locate "blank" and replace it with "_self" to cause the link to load in the same window..


For the site image
Code:

if ($thumbshot == "1"){$htmlsrc .="height=\"90\"> <td valign=\"top\" width=\"120\" class=\"" . $cell_color . "\" background=./images/na.gif> <a target=\"blank\" href=./out.php?ID=" . $sites_array[site_id] . ">"; $htmlsrc .="<img border=\"0\" align=\"top\" src=http://open.thumbshots.org/image.pxf?url=". urlencode($sites_array["site_url"]) ."></a></td><td valign=\"top\" class=\"" . $cell_color . "\">";
For the site name . . . .
Code:

$htmlsrc .= "ID=" . $sites_array[site_id] . "\" target=\"_"; if($user_outer_frame == "Y"){$htmlsrc .= "top";}else{$htmlsrc .= "blank";} $htmlsrc .= "\">" . stripslashes($sites_array["site_name"]) . "</a>";
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#1055
IceMan (User)
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
Re:Thumbshots alternative 1 Year ago Karma: 0  
And here was me thinking you were infalible
That worked for the image link but not the text link
I have quiet a few things im trying to change as i am using the script for a whole new concept. I have used it in a few other sites and realised just how Multifunctional it can be.
Sorry to be a pain....once im sorted a suitable donation will be sent as i appreciate your help.

IceMan
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#1056
Dewed (Admin)
Admin
Posts: 534
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:Thumbshots alternative 1 Year ago Karma: 9  
The code that creates the text link should be just below where the image tag is created, but if you have the "use outter frame" option enabled in the admin config page, you may be bypassing your edits.

The original code
Code:

$htmlsrc .= "<a class=\"siteName\" href=\"" . "out"; if($user_outer_frame == "Y"){$htmlsrc .= "_frame";} $htmlsrc .= ".php?"; if ($usesession =="yes"){$htmlsrc .= "". session_name()."=".session_id() ."&amp;";} $htmlsrc .= "ID=" . $sites_array[site_id] . "\" target=\"_"; if($user_outer_frame == "Y"){$htmlsrc .= "top";}else{$htmlsrc .= "blank";} $htmlsrc .= "\">" . stripslashes($sites_array["site_name"]) . "</a>";
Keep in mind the links point to either out.php or out_frame.php which then redirects the the actual site in order to tally outbound clicks. So the following should give you what you want.
Code:

$htmlsrc .= "ID=" . $sites_array[site_id] . "\" target=\"_"; if($user_outer_frame == "Y"){$htmlsrc .= "top";}else{$htmlsrc .= "self";}
 
Report to moderator   Logged Logged  
 
Last Edit: 2009/09/13 23:02 By Dewed.
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
Outsource your projects to thousands of programmers at
ScriptLance.com
Newsflash
Interested in
advertising?

This space for rent!

Sign up for PayPal and start accepting credit card payments instantly.
Copyright Dew-Code 2008