Results 1 to 8 of 8
  1. #1
    Constant Pligger nellaitamil's Avatar
    Joined
    Dec 2008
    Posts
    208

    How to create sidebar random image?

    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

  2. #2
    Pligg Founder Yankidank's Avatar
    Joined
    Dec 2005
    Location
    San Francisco, CA
    Posts
    5,063
    Site
    http://pligg.com/demo/
    I believe the example code should still work, just make sure that you follow the directions.
    The Facebook Module for Pligg CMS!
    Register, Login, and Submit Stories with Facebook. An absolute MUST HAVE for all Pligg sites!

  3. #3
    Constant Pligger nellaitamil's Avatar
    Joined
    Dec 2008
    Posts
    208
    ok sir.

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

    pls.. help sir.

  4. #4
    Constant Pligger sansui's Avatar
    Joined
    Aug 2008
    Location
    India
    Posts
    183
    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

  5. #5
    Constant Pligger nellaitamil's Avatar
    Joined
    Dec 2008
    Posts
    208
    Thanks sansui.

    This code not working...

    add this code...

    but

    sidebar closed...

    what hapend?

    chuckroast or yankidank pls help this post...

  6. #6
    New Pligger jgonza12's Avatar
    Joined
    Jun 2009
    Posts
    14

    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 ()

  7. #7
    Constant Pligger nellaitamil's Avatar
    Joined
    Dec 2008
    Posts
    208
    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.

  8. #8
    New Pligger jgonza12's Avatar
    Joined
    Jun 2009
    Posts
    14

    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?

Similar Threads

  1. How to create a sidebar story with the most votes?
    By roxy in forum Questions & Comments
    Replies: 0
    Last Post: 12-11-2011, 04:33 PM
  2. place an image in the sidebar
    By anjosdogb in forum Questions & Comments
    Replies: 7
    Last Post: 09-15-2011, 11:11 AM
  3. Random Link Cloud Box
    By chuckroast in forum Modules for Sale
    Replies: 0
    Last Post: 07-11-2008, 08:10 AM
  4. Random Story
    By Geoserv in forum Questions & Comments
    Replies: 7
    Last Post: 04-21-2008, 08:33 PM
  5. adding a random image in header.tpl
    By bizna in forum Questions & Comments
    Replies: 3
    Last Post: 01-01-2008, 09:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Donate to Pligg CMS Dreamhost Web Hosting Host Gator Web Hosting