vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v1.x (Archive - Closed for Posting) > Add-On Modules & Modifications

 
 
Thread Tools Display Modes
  #1  
Old 05-24-2004, 11:08 AM
dbabaev dbabaev is offline
Junior Member
 
Join Date: Mar 2004
Posts: 25
Default Working Thumbincluder... Please?

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  
Old 05-25-2004, 08:56 PM
dbabaev dbabaev is offline
Junior Member
 
Join Date: Mar 2004
Posts: 25
Default Re: Working Thumbincluder... Please?

come on, anyone?
  #3  
Old 06-30-2004, 11:44 AM
attroll's Avatar
attroll attroll is offline
Senior Member
 
Join Date: Jan 2004
Posts: 818
Default Re: Working Thumbincluder... Please?

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
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:
Code:
$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:
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.
Attached Files
File Type: txt thumbincluder11.txt (10.9 KB, 181 views)
  #4  
Old 07-12-2004, 11:37 AM
allandk allandk is offline
Junior Member
 
Join Date: Jun 2004
Posts: 14
Default Re: Working Thumbincluder... Please?

Query failed !!
  #5  
Old 07-13-2004, 09:26 AM
teksigns teksigns is offline
Member
 
Join Date: Apr 2004
Posts: 37
Default Re: Working Thumbincluder... Please?

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  
Old 07-13-2004, 09:34 AM
allandk allandk is offline
Junior Member
 
Join Date: Jun 2004
Posts: 14
Default Re: Working Thumbincluder... Please?

i found the error.. i had prefix in my db name, and it was missing in the code )
  #7  
Old 07-13-2004, 09:47 AM
teksigns teksigns is offline
Member
 
Join Date: Apr 2004
Posts: 37
Default Re: Working Thumbincluder... Please?

Quote:
Originally Posted by teksigns
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"));


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

Code:
if (defined('VBA_PORTAL')){
$postthumbnail = implode("", file("http://www.yoursite.com/photopost/thumbincluder11.php"));
}
  #8  
Old 07-15-2004, 04:08 PM
Fargo Fargo is offline
Member
 
Join Date: Jul 2004
Posts: 46
Default Re: Working Thumbincluder... Please?

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  
Old 07-15-2004, 05:59 PM
Fargo Fargo is offline
Member
 
Join Date: Jul 2004
Posts: 46
Default Re: Working Thumbincluder... Please?

btw teksigns,
your code worked perfectly, thank you very much for sharing it.
  #10  
Old 07-19-2004, 12:31 AM
banjolawyer banjolawyer is offline
Junior Member
 
Join Date: Jun 2004
Posts: 21
Default Re: Working Thumbincluder... Please?

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:
<!-- 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_blockbulletLatest Photo Gallery Uploads</b></span>
</
td>
</
tr>
<
tr><td width="100%" class="alt1">$postthumbnail 
</td></tr></table
</
td></tr></table>
<!-- /
thumbnail --> 
__________________
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  
Old 07-19-2004, 12:32 AM
banjolawyer banjolawyer is offline
Junior Member
 
Join Date: Jun 2004
Posts: 21
Default Re: Working Thumbincluder... Please?

The change is just changing
PHP Code:
<center><b>Latest Pictures</b></center
to
PHP Code:
<span class="smallfont"><b>$vba_options[portal_blockbulletLatest Photo Gallery Uploads</b></span
__________________
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  
Old 07-19-2004, 05:11 AM
Kesomir's Avatar
Kesomir Kesomir is offline
Member
 
Join Date: Apr 2004
Location: London, UK
Posts: 70
Default Re: Working Thumbincluder... Please?

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:
         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;

PHP Code:

         
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.
__________________
Kesomir
"It's an undocumented feature, not a bug"

| Dynamic Staffpage :: vB3.07 :: vB3.6.1 |




  #13  
Old 07-20-2004, 11:53 AM
Ted S Ted S is offline
Junior Member
 
Join Date: Jul 2004
Posts: 11
Default Re: Working Thumbincluder... Please?

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  
Old 07-20-2004, 03:01 PM
Kesomir's Avatar
Kesomir Kesomir is offline
Member
 
Join Date: Apr 2004
Location: London, UK
Posts: 70
Default Re: Working Thumbincluder... Please?

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"

| Dynamic Staffpage :: vB3.07 :: vB3.6.1 |




  #15  
Old 07-26-2004, 08:45 AM
gemfsb gemfsb is offline
Junior Member
 
Join Date: Jul 2004
Posts: 17
Default Re: Working Thumbincluder... Please?

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  
Old 07-26-2004, 03:17 PM
Ted S Ted S is offline
Junior Member
 
Join Date: Jul 2004
Posts: 11
Default Re: Working Thumbincluder... Please?

Wonderful addon and thanks to everyone for contributing even more changes/features!
  #17  
Old 07-27-2004, 07:42 AM
gemfsb gemfsb is offline
Junior Member
 
Join Date: Jul 2004
Posts: 17
Default Re: Working Thumbincluder... Please?

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  
Old 07-27-2004, 10:26 AM
gemfsb gemfsb is offline
Junior Member
 
Join Date: Jul 2004
Posts: 17
Default Re: Working Thumbincluder... Please?

update
  #19  
Old 07-27-2004, 10:26 AM
gemfsb gemfsb is offline
Junior Member
 
Join Date: Jul 2004
Posts: 17
Default Re: Working Thumbincluder... Please?

comeon guys, no one knows?
  #20  
Old 07-29-2004, 02:58 PM
Kesomir's Avatar
Kesomir Kesomir is offline
Member
 
Join Date: Apr 2004
Location: London, UK
Posts: 70
Default Re: Working Thumbincluder... Please?

gemfsb, the one for popular is;

$q_switch = "most_views";
__________________
Kesomir
"It's an undocumented feature, not a bug"

| Dynamic Staffpage :: vB3.07 :: vB3.6.1 |




 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -4. The time now is 10:36 AM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.