![]() |
|
#1
|
|||
|
|||
|
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...
I've looked all over and tried many things but no luck... I would really appreciate it. www.russianpimp.com |
|
#2
|
|||
|
|||
|
come on, anyone?
|
|
#3
|
||||
|
||||
|
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: Code:
$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 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: Code:
$postthumbnail = implode("", file("http://www.yoursite.com/gallery/thumbincluder11.php"));
In that table put this code: 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 --> - 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. |
|
#4
|
|||
|
|||
|
Query failed !!
|
|
#5
|
|||
|
|||
|
anyway to keep this line of code from running unless the main page is loaded .
Code:
$postthumbnail = implode("", file("http://www.yoursite.com/gallery/thumbincluder11.php"));
|
|
#6
|
|||
|
|||
|
i found the error.. i had prefix in my db name, and it was missing in the code
)
|
|
#7
|
|||
|
|||
|
Quote:
im assuming this will work ..... correct? Code:
if (defined('VBA_PORTAL')){
$postthumbnail = implode("", file("http://www.yoursite.com/photopost/thumbincluder11.php"));
}
|
|
#8
|
|||
|
|||
|
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. |
|
#9
|
|||
|
|||
|
btw teksigns,
your code worked perfectly, thank you very much for sharing it. |
|
#10
|
|||
|
|||
|
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.
PHP Code:
__________________
the sites I tinker with: johnlittle.com | alabamahealthlaw.org | healthfraudnews.org | thelittles.net Last edited by banjolawyer; 05-17-2005 at 07:40 PM. Reason: signature |
|
#11
|
|||
|
|||
|
The change is just changing
PHP Code:
PHP Code:
__________________
the sites I tinker with: johnlittle.com | alabamahealthlaw.org | healthfraudnews.org | thelittles.net Last edited by banjolawyer; 05-17-2005 at 07:40 PM. Reason: signature |
|
#12
|
||||
|
||||
|
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; PHP Code:
PHP Code:
__________________
Kesomir "It's an undocumented feature, not a bug" |
|
#13
|
|||
|
|||
|
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?
|
|
#14
|
||||
|
||||
|
Ted, not if you use teksigns small code change above, then it should only be run when a portal page is called.
__________________
Kesomir "It's an undocumented feature, not a bug" |
|
#15
|
|||
|
|||
|
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 |
|
#16
|
|||
|
|||
|
Wonderful addon and thanks to everyone for contributing even more changes/features!
|
|
#17
|
|||
|
|||
|
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. |
|
#18
|
|||
|
|||
|
update
|
|
#19
|
|||
|
|||
|
comeon guys, no one knows?
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Thumbincluder and a center block | Porthos | Troubleshooting / "How do I..." Questions | 13 | 04-05-2006 08:31 AM |