How to create sidebar random image?

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-09-2010, 09:48 AM
nellaitamil's Avatar
Constant Pligger/Designer
Pligg Version: 9.9.0
 
Join Date: Dec 2008
Posts: 155
How to create sidebar random image?

pligg mods code not work in my site...

pls help this post..

My site

Ta milers.com - Submit News for | lawyer | student loan | data recovery | data recovery | auto insurance | hard drive recovery | reverse mortgage
Reply With Quote
  #2 (permalink)  
Old 02-09-2010, 11:49 AM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 3,803
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
I believe the example code should still work, just make sure that you follow the directions.

Now Available: Facebook Connect Module !
Reply With Quote
  #3 (permalink)  
Old 02-09-2010, 11:52 AM
nellaitamil's Avatar
Constant Pligger/Designer
Pligg Version: 9.9.0
 
Join Date: Dec 2008
Posts: 155
ok sir.

am add in the code in my site. but sidebar not work.

pls.. help sir.
Reply With Quote
  #4 (permalink)  
Old 02-09-2010, 01:12 PM
sansui's Avatar
Casual Pligger/Coder/Designer
Pligg Version: 1.0.3
Pligg Template: Season
 
Join Date: Aug 2008
Posts: 78
Quote:
Originally Posted by nellaitamil View Post
ok sir.

am add in the code in my site. but sidebar not work.

pls.. help sir.
<br><!-- Begin Thumbnail Snippet -->
<br><div class="sidebar-top"></div>
<br><div class="sidebar">
<br> <div class="headline">
<br> <div class="sectiontitle">Random Image</div>
<br> </div>
<br> <div class="boxcontent">
<br> <table width="100%" border="0">
<br> {php}
<br> // 200x200 is the thumbnail size to show
<br> // Limit 1 is how many thumbnails to show
<br> $query = "SELECT * FROM pligg_files where file_size = '200x200' ORDER BY RAND() LIMIT 1";
<br> $result = mysql_query($query) or die(mysql_error());
<br> while($row = mysql_fetch_array($result)){
<br> echo '<tr><td align="center">';
<br> echo "<a href="story.php?id=".$row[file_link_id].""><img src="./modules/upload/attachments/thumbs/".$row[file_name]."" /></a>";
<br> echo "</td></tr>";
<br> }
<br> {/php}
<br> </table>
<br> </div>
<br></div>
<br><!-- End Thumbnail Snippet -->
<br>

Nellai i think this code your using

wat thumbnail size your using ??

check your thumbnail size and modify code above code used 200x200
if your using 200x200 then its work otherwise its not work

Thanks & Regards

Thisworld4u
Reply With Quote
  #5 (permalink)  
Old 02-10-2010, 01:09 AM
nellaitamil's Avatar
Constant Pligger/Designer
Pligg Version: 9.9.0
 
Join Date: Dec 2008
Posts: 155
Thanks sansui.

This code not working...

add this code...

but

sidebar closed...

what hapend?

chuckroast or yankidank pls help this post...
Reply With Quote
  #6 (permalink)  
Old 02-22-2010, 07:21 AM
jgonza12's Avatar
New Pligger
Pligg Version: 1.0.3
Pligg Template: fuzenews
 
Join Date: Jun 2009
Location: Cali
Posts: 10
Quote:
Originally Posted by nellaitamil View Post
Thanks sansui.

This code not working...

add this code...

but

sidebar closed...

what hapend?

chuckroast or yankidank pls help this post...


Hello nellaitamil,

I modify the script. it should work i have tested it.



PHP Code:
<!-- Begin Thumbnail Snippet -->
<
div class="sidebar-top"></div>
<
div class="sidebar">
    <
div class="headline">
        <
div class="sectiontitle">Random Image</div>
    </
div>
    <
div class="boxcontent">
        <
table width="100%" border="0">

            {
php}
            
$query "SELECT * FROM (?files)  where file_size = '200x200' ORDER BY RAND() LIMIT 4";
            
$result mysql_query($query);
            while(
$row mysql_fetch_array($resultMYSQL_ASSOC))
            {           
printf ('<tr><td align="center">');
printf ('<a href="story.php?id=%s"><img src="./modules/upload/attachments/thumbs/%s" border="0">',$row["file_link_id"],$row["file_name"])</a>;
printf ('</td></tr>');
            }
            {/
php}

        </
table>
    </
div>
</
div>
<!-- 
End Thumbnail Snippet --> 
just change the "?" in( SELECT * FROM (?files) where file_size ) with your prefix and remove the ()

Last edited by jgonza12; 02-25-2010 at 11:09 AM.
Reply With Quote
  #7 (permalink)  
Old 02-22-2010, 10:12 AM
nellaitamil's Avatar
Constant Pligger/Designer
Pligg Version: 9.9.0
 
Join Date: Dec 2008
Posts: 155
Quote:
Originally Posted by jgonza12 View Post
Hello nellaitamil,

I modify the script. it should work i have tested it.



PHP Code:
<!-- Begin Thumbnail Snippet -->
<
div class="sidebar-top"></div>
<
div class="sidebar">
    <
div class="headline">
        <
div class="sectiontitle">Random Image</div>
    </
div>
    <
div class="boxcontent">
        <
table width="100%" border="0">

            {
php}
            
$query "SELECT * FROM (?files)  where file_size = '200x200' ORDER BY RAND() LIMIT 4";
            
$result mysql_query($query);
            while(
$row mysql_fetch_array($resultMYSQL_ASSOC))
            {           
printf ('<tr><td align="center">');
printf ('<a href="story.php?id=%s"><img src="./modules/upload/attachments/thumbs/%s" border="0">',$row["file_link_id"],$row["file_name"]);
printf ('</td></tr>');
            }
            {/
php}

        </
table>
    </
div>
</
div>
<!-- 
End Thumbnail Snippet --> 
just change the "?" in( SELECT * FROM (?files) where file_size ) with your prefix and remove the ()
/////////////////
How do change (?files) ....

chenge the example?

am not coder...
pls help...

sorry my bed english.
nellaitamil.
Reply With Quote
  #8 (permalink)  
Old 02-22-2010, 06:34 PM
jgonza12's Avatar
New Pligger
Pligg Version: 1.0.3
Pligg Template: fuzenews
 
Join Date: Jun 2009
Location: Cali
Posts: 10
Quote:
Originally Posted by nellaitamil View Post
/////////////////
How do change (?files) ....

chenge the example?

am not coder...
pls help...

sorry my bed english.
nellaitamil.

Go to your confi in your pligg admin panel and go straight to MySQL Table Prefix and next to value tell me what it you have?
Reply With Quote
Reply

Tags
random image

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload Module (File and Image Attachment) Yankidank Free Modules 158 Yesterday 04:49 PM
Upload Module Image Resize and Crop Yankidank Questions and Comments 6 01-28-2010 11:05 PM
adding a random image in header.tpl bizna Questions and Comments 3 01-01-2008 12:32 PM
Miising loading image in image upload/thickbox module Peter Questions and Comments 5 12-06-2007 02:24 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development