PDA

View Full Version : Working Thumbincluder... Please?



dbabaev
05-24-2004, 11:08 AM
Can someone give me a working version of the Thumbincluder? I have VB 3.0.1, PhotoPost PHP 4.8 RC 3, and vBadvanced CMPS v1.0 RC2. All I want a random thumb on my home page... :o

I've looked all over and tried many things but no luck... I would really appreciate it. www.russianpimp.com

dbabaev
05-25-2004, 08:56 PM
come on, anyone?

Our Sponsors
 

attroll
06-30-2004, 11:44 AM
This is my attempt at trying to explain how to do this for you. I did it and have it working in one of my sites. So I know it works. You will have to use thumbincluder11 on your site to get this to be used on your front page for latest photos if your using CMPS...

If I missed something our it does not work I will try and explain it and get it working for you. But I can not promise because I do not know what mods you have installed in your site that may interfear with it.

1. Make the changes in the thumbincluder11.php that is included with this message using a editor. It would not let me attach the thumbincluder as a PHP file so once you download it you will have to rename it to a PHP extension. Right now it is TXT.

You will have to change the following lines:


$host = "localhost"; //Server Name
$user= ""; //Username
$password= ""; //Password
$database=""; //Photopost database name or forum database name
//Display Setting (Changes to fit your page)
$q_switch = "latest"; // "random" or "most_views" or "latest"
$limit = 2; //number of image to show
$table_width = "100%"; //width of the table generated
$column = 2; //number of columns of the table generated
$photo_cell_align = "center"; //alignment of those cells


2. After you have made these changes put the file "thumbincluder11.php" in the gallery directory.

3. Go into your ADMINCP template “PHP Include Code Templates/phpinclude_start” and insert the code below. You will have to make some changes to it to match your web site address .

Posted the following in my phpinclude_start template:


$postthumbnail = implode("", file("http://www.yoursite.com/gallery/thumbincluder11.php"));


4. Create a new template in you ADMINCP and call it “adv_portal_thumb”.
In that table put this code:


<!-- thumbnail -->
<table cellpadding="$stylevar[outerborderwidth]" cellspacing="0" border="0" class="tborder" width="$stylevar[tablewidth]" align="center"><tr><td>
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td class="tcat">
<center><b>Latest Pictures</b></center>
</td>
</tr>
<tr><td width="100%" class="alt1">$postthumbnail
</td></tr></table>
</td></tr></table>
<!-- /thumbnail -->


5. Still in your Admincp - vBa CMPS - Add Module

- Module Title - Thumbincluder
- Module Identifier - Leave blank
- OR Template to Include - thumb
- Activate and select the column you want it in.
- Save and you are done.

allandk
07-12-2004, 11:37 AM
Query failed !!

Our Sponsors
 

teksigns
07-13-2004, 09:26 AM
anyway to keep this line of code from running unless the main page is loaded .


$postthumbnail = implode("", file("http://www.yoursite.com/gallery/thumbincluder11.php"));

allandk
07-13-2004, 09:34 AM
i found the error.. i had prefix in my db name, and it was missing in the code :o)

teksigns
07-13-2004, 09:47 AM
anyway to keep this line of code from running unless the main page is loaded .


$postthumbnail = implode("", file("http://www.yoursite.com/gallery/thumbincluder11.php"));




im assuming this will work ..... correct?



if (defined('VBA_PORTAL')){
$postthumbnail = implode("", file("http://www.yoursite.com/photopost/thumbincluder11.php"));
}

Fargo
07-15-2004, 04:08 PM
another thing that ive come across -

If you've installed Photopost into your vBulletin database and have assigned a prefix to your photopost tables, you will need to modify EVERY select statement in this thumbnailincluder file.

For example, In my installation of Photopost, I had it give its tables a prefix of "PP_".
All select statements for category must be changed to PP_category and select statements for photos must be changed to PP_photos.

examples:

SELECT id FROM categories WHERE parent='$cat' ORDER BY catorder ASC
must be changed to
SELECT id FROM PP_categories WHERE parent='$cat' ORDER BY catorder ASC

SELECT id,user,userid,cat,title,bigimage,views FROM photos WHERE bigimage!='' AND approved='1' $exclude_cat ORDER BY RAND() DESC LIMIT $limit";
must be changed to
SELECT id,user,userid,cat,title,bigimage,views FROM PP_photos WHERE bigimage!='' AND approved='1' $exclude_cat ORDER BY RAND() DESC LIMIT $limit";

Easiest thing to do is do a search and replace because there are several statements to alter.

Fargo
07-15-2004, 05:59 PM
btw teksigns,
your code worked perfectly, thank you very much for sharing it.

banjolawyer
07-19-2004, 12:31 AM
Thanks for the work. I modified the adv_portal_thumb template so that the Title line for the module would be the same as other vbadvanced modules.


<!-- thumbnail -->
<table cellpadding="$stylevar[outerborderwidth]" cellspacing="0" border="0" class="tborder" width="$stylevar[tablewidth]" align="center">
<tr>
<td>

<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td class="tcat">
<span class="smallfont"><b>$vba_options[portal_blockbullet] Latest Photo Gallery Uploads</b></span>
</td>
</tr>
<tr><td width="100%" class="alt1">$postthumbnail
</td></tr></table>
</td></tr></table>
<!-- /thumbnail -->

banjolawyer
07-19-2004, 12:32 AM
The change is just changing
<center><b>Latest Pictures</b></center> to
<span class="smallfont"><b>$vba_options[portal_blockbullet] Latest Photo Gallery Uploads</b></span>

Kesomir
07-19-2004, 05:11 AM
I found that this also doesn't seem to stripslashes (thats the \ before any ")from the picture name. (Actually neither do the photopost ones - odd huh), so I changed the code to fix this;

Find lines 229-233;



print "<br>".$line["title"]."<br>".$line["views"]." views";
print "</a><br></font></div><br>";
} else {
print "<br>".$line["title"];
print "</a><Br>by ".$line["user"]."</font></div><br>";


Change to this;




print "<br>".stripslashes($line["title"])."<br>".$line["views"]." views";
print "</a><br></font></div><br>";
} else {
print "<br>".stripslashes($line["title"]);
print "</a><Br>by ".$line["user"]."</font></div><br>";



Hope that helps.

Ted S
07-20-2004, 11:53 AM
Seeing how this template goes into the regular php start file am I to assume this script runs every time any vb file is loaded even if the module is not called?

Kesomir
07-20-2004, 03:01 PM
Ted, not if you use teksigns small code change above, then it should only be run when a portal page is called.

gemfsb
07-26-2004, 08:45 AM
hi

thank you very much for the code:)

would you pls tell what the word for the popular photo?
($q_switch = "random"; ) what should i put for popular.

thank you

Ted S
07-26-2004, 03:17 PM
Wonderful addon and thanks to everyone for contributing even more changes/features!

gemfsb
07-27-2004, 07:42 AM
what if I want only the popular photos to display ?

should I write just "popular" instead of "random" is this word modified to the code.

gemfsb
07-27-2004, 10:26 AM
update

gemfsb
07-27-2004, 10:26 AM
comeon guys, no one knows?

Kesomir
07-29-2004, 02:58 PM
gemfsb, the one for popular is;

$q_switch = "most_views";

gemfsb
08-04-2004, 04:50 AM
thank you Kesomir :)

gemfsb
08-04-2004, 06:12 AM
this code support English language for the photo titles only, How could I make it support other language?

thank you

Lizard King
08-09-2004, 01:28 PM
Can I use this with 4images gallery ?
Or is there a module for that ?

Kesomir
08-09-2004, 03:58 PM
This is only for photopost.

Try here for 4images (http://www.vbadvanced.com/forum/showthread.php?t=1629&highlight=4images)

link curtesy of the search function ;)

iwbyte
08-18-2004, 12:13 PM
Works great - thanks!

One change - I found I had to add a <br /> to the end of the adv_portal_thumb template in order to give the space between modules that all the other ones had.

fortnox
08-20-2004, 06:19 AM
Hi!

I have a Problem, that when the discription of Picture is too long (DSCN0112www_xxxxx-online_com), the full module goes bigger than the other.

Does ist goe, that if the Discription is longer that x here comes ...

Thanks for your help!

TheNakedMan
09-26-2004, 09:01 AM
Thanks this worked!

TheNakedMan
10-19-2004, 12:00 PM
What if I wanted to add this also just go Adv and Index...

I tried 'FORUMHOME', but that didnt seem to work!

memobug
10-19-2004, 09:23 PM
i found the error.. i had prefix in my db name, and it was missing in the code :o)

Sorry, Alan. At the time the module was written there were no prefixes in PhotoPost databases. That came later.

Regards,

Matt

lee wilde
11-01-2004, 10:22 PM
Thanks Attroll for this excellent little mod and for everyone who contributed fix's.

jt420
12-10-2004, 03:18 AM
excellent mod i was looking for this. im bad with coding but this was a breeze!

+buG
12-14-2004, 08:20 PM
would it be possible to only display a certain category from your gallery?

Mirzone
12-31-2004, 09:24 PM
would it be possible to only display a certain category from your gallery?

Im also after this :cool:

nomadelmundo
03-24-2005, 12:05 PM
okay i must be doing something wrong, because no images are showing up, can someone help me out...
my site is at planetnomads.com
and photopost is at planetnomads.com/photopost

do you guys have directories like /1, /2, /500, /501 in your date directories... maybe i am not pointing to the right data directories... thanks

sapper6fd
03-27-2005, 10:41 PM
Anyone tried using this with the latest version of Photopost, 5.02??? The thumbs dont seem to work at all. Just shows up as Thumbnail Not available. Any ideas? I've just updated my Photopost to this version, and now the thumbicluder doesnt work.

sapper6fd
03-27-2005, 11:20 PM
Ok, I've found a fix. There are two links that need to be fixed in the thumbincluder11.php file. You need to change the following lines



$filepath = "$data_dir"."$thecat/$temp_user$photo_name-thumb.$theext";
$rel_path = "$rel_dir"."$thecat/$temp_user$photo_name-thumb.$theext";


Change it to:



$filepath = "$data_dir"."$thecat/thumbs/$photo_name.$theext";
$rel_path = "$rel_dir"."$thecat/thumbs/$photo_name.$theext";


That should make the thumb includer work.

KIX
08-03-2005, 07:24 PM
Works perfectly ...thakns (with the last mod)

to see a demo see: www.auto-mania.com.mx

sross
09-16-2005, 05:37 AM
Hi, I just keep getting query failed and can't for the life of me figure out why. As far as I can tell everything is set right, any ideas? My install does not use prefixes, i'm on v5 photopost. I'm at my wits end :(

sross
09-16-2005, 04:55 PM
i figured it out, some of the queries near the bottom that said "From photopost" needed my photopost prefix "From galleryphotopost" :)