PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   Photopost Pro How Do I...? (http://www.photopost.com/forum/photopost-pro-how-do-i/)
-   -   latest upload code for cmps (http://www.photopost.com/forum/photopost-pro-how-do-i/130601-latest-upload-code-cmps.html)

rcull February 22nd, 2007 10:27 PM

latest upload code for cmps
 
I was lucky enough that a young fellow was nice enough to write this bit for my cmps page to bring up my most recent showroom additions. Unfortunaly, it brings up private albums too...

Is there anyone who would like to modify it to not bring up the private albums?

I expect there are quite a few who would like it!...:)


************

<table align="center" border="0" cellpadding="6" cellspacing="1" class="tborder" width="100%">
<thead>
<tr>
<td class="tcat" colspan="4">
<a href="#top" onclick="return toggle_collapse('module_26')" style="float:right"><img alt="" border="0" id="collapseimg_module_26" src="http://www.yoursite.com/forums/images/buttons/collapse_tcat.gif" /></a>
<span class="smallfont"><strong>&raquo;Photopost Uploads</strong></span></td>
</tr>
</thead>
<tbody id="collapseobj_module_26" bgcolor="fffceb">
<td class="$getbgrow" width="100%"><center><br><table><tr>

<?php
function pp_get_ext( $filename ) {
return substr($filename, strrpos($filename,"."));
}

$result = mysql_query('SELECT p.id, p.cat, p.user, p.userid, p.bigimage, p.title FROM pp_photos p WHERE p.bigimage LIKE \'%.jpg\' ORDER BY date DESC LIMIT 0, 4');
while($row = mysql_fetch_array($result,MYSQL_NUM))
{
$photo = $row[4];
$photolen = strlen($photo);
$theext = pp_get_ext($photo);
$photo_name = str_replace( $theext, "", $photo );

echo '<td width="25%"><a href=http://www.yoursite/photopost/showphoto.php?photo='.$row[0].'>'.
// '<img src=http://www.yoursite/photopost//data/'.$row[1].'/'.$row[3].$photo_name.'-thumb'.$theext.' border=0></a>'.
'<img src=http://www.yoursite/photopost/data/'.$row[1].'/thumbs/'.$photo_name.''.$theext.' border=0></a>'.


'<br>'.$row[5].
'<br><b>'.$row[2].'</b><br></td>';
}

?>
</tr></table></center>
</td>
</tbody>
</table>
<br />



************


Thanks!

Chuck S February 23rd, 2007 08:29 AM

You need to upgrade immediately as older versions like yours have serious security holes.

Maybe this in your query

Code:

Content visible to verified customers only.


All times are GMT -5. The time now is 01:59 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97