View Full Version : anyone tried todo a photopostpal with ipb?

September 8th, 2004, 06:49 PM

I'm trying, so far so good...not really

ipb...hmmm doesn't use $ in any templates right? thus if i insert a $photopostfeature or anything like that i'm stuffed... also i'm trying to find the string that holds the ipb.member['id'] - but i cannot use $ in ipb (i'm on v2.0 using 4.8.2) ahh...any help would be greatly recieved

edit, my databases are one, i'm trying to use the membergrouping to view thumbs or if not logged in show another thumb of my choosing, worked on VB... maybe i'll use the photopost group table instead



September 9th, 2004, 11:07 AM
What are you trying to do? ...bring IPB into PP as a PAL? If so, I'd be interested in this also.


September 9th, 2004, 01:36 PM
no just the recent photos in the ipb index


September 9th, 2004, 02:32 PM
where's omegatron...? :)

i'm stuck, i get and invalid "mysql_fetch_array(): supplied argument is not a valid MySQL result resource"

gotta be right right?

I'm trying to make a photopost pal to show the recent images on my ipb index page, the query is good to my knowledge, i'm not sure if my 'mgroups' line is halting things, actually i removed it and still the same...please advise, i'll keep working :)

// which type of images do you want to show
$q_switch = "latest";

switch ($q_switch) {
case "latest":
$query = "SELECT id,user,userid,cat,title,bigimage,views FROM {$Globals['dprefix']}photos ORDER BY date DESC";
$result = mysql_query($query);

$counted = 0; $featured = "";

while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$photo = $line["bigimage"];

if ( pp_is_image($photo) ) {
$photolen = strlen($photo);
$theext = pp_get_ext($photo);
$photo_name = str_replace( $theext, "", $photo );

$temp_user = $line["userid"];

if (($mgroups['usergroupid'] == "2") || ($mgroups['usergroupid'] == "8") || ($mgroups['usergroupid'] == "1"))
$thumbtag = "";
$mthumb = "<table width=\"0\" border=\"0\" class=\"vbulletin_editor\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><a href=\"http://www.sgurl.org/forums/subscriptions.php\"><img border=\"0\" src=\"{$main_dir}subscribe.gif\" alt=\"subscribe today to view all\" /></a></td></tr></table>";
$thumbtag = "{$full_path}{$line['cat']}/{$line['userid']}{$photo}";
$mthumb = "<table width=\"0\" border=\"0\" class=\"vbulletin_editor\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><a href=\"{$url_path}/showphoto.php?photo={$line['id']}\"><img border=\"0\" src=\"{$data_dir}{$line['cat']}/{$line['userid']}{$photo_name}-thumb{$theext}\" alt=\"Uploaded by {$line['user']}\" /></a></td></tr></table>";
// One box for each feature
$featured .= <<<PPPRINT
<td align="center" bgcolor="#4C545F" width="20%"><table width="0" height="0" border="0" align="center" cellpadding="0" cellspacing="0">
<tr align="center" valign="bottom">
<td colspan="3"><img src="border_01.gif" width="144" height="13" border="0" align="bottom"></td>
<td width="17" background="border_02.gif">&nbsp;</td>
<td width="111" height="0" align="center" bgcolor="#616B71">$mthumb</td>
<td width="16" background="border_04.gif">&nbsp;</td>
<tr align="center" valign="top">
<td height="9" colspan="3"><img src="border_05.gif" width="144" height="13" border="0" align="top"></td>

if ( $counted == 5 ) break;

// First part is for the featured photos
// $photopostfeature not holds the Featured Photos box and $photopostcats (set below) holds the
// gallery list

$photopostfeature = <<<PPPRINT
<style type="text/css">
.style4 {
color: #D7D7D7;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
<table class="tborder" cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<table cellpadding="$stylevar[cellpadding]" cellspacing="1" border="0" width="100%">
<td colspan="5" align="left" valign="middle" class="tcat">
<img src="../forums/images/hardwired/statusicon/user_online2.gif" border="0" align="absmiddle"> <span class="style4"><b>New Sgurl Pictures</b> : Last
Upload by {$line['user']}</span></td>

October 8th, 2004, 05:42 PM
Did anyone get this to work? I would really like to get some random photopost photos on my IPB 2.0 index page.

October 8th, 2004, 07:42 PM
yeah i got it to work, check photopostdev.com :)


October 9th, 2004, 05:42 AM
I see that Toney, but I have mine setup in 2 seperate databases also.

Is there a fix for that?

Chuck S
October 9th, 2004, 08:18 AM
Yep Toney's problem was he was trying to define variables from ourside of photopost in IBP from looking at the code

If you need to use different databases just use the mysql select database

If they have the same user and password you can use this


If they have different user/password you need to setup a link statement and this

$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Not connected : ' . mysql_error());

// make foo the current db
$db_selected = mysql_select_db('foo', $link);
if (!$db_selected) {
die ('Can\'t use foo : ' . mysql_error());

Michael P
October 9th, 2004, 09:34 AM
http://www.photopostdev.com is the site we discuss subjects like this that involve coding issues. ;)

October 9th, 2004, 01:11 PM
omegatron, after trying what you said (mysql_select_db("db1");), I now get this error "Could not select photopost database"

Got any other ideas? Besides moving the database?


Chuck S
October 9th, 2004, 01:43 PM
As Michael stated this kind of question is not answered on a support forum where we do not discuss hacking but help customers with the normal program

You need to ask your hacking questions at the hack site as I was just being nice and pointing you in the right direction

October 9th, 2004, 01:50 PM
Ok, will do, thanks