Michael and Chuck, good job on this hack! <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /><br /><br />I've had a few good PMs come through from my site letting me know what a nice addition we've made. <img src="http://www.ubbdev.com/forum/images/graemlins/waytogo.gif" alt="" /><br /><br />No bugs to report at this time under v6.4
Omeatron, in your instruction you write: <br />$data_dir = "http://www.reeftalk.com/photos" ; //URL of your photo dir where those jpeg stored (with no / at end)<br /><br />in your ppanel.php you write:<br />//URL of your photo dir where those jpeg stored (with / at end)<br /><br />Which is correct ?
I don't bring this hack to work <img src="http://www.ubbdev.com/forum/images/graemlins/frown.gif" alt="" /> <br /><br />I also get this error:<br /><br />SQL ERROR: Sun, Feb 01 2004 12:48:53 +0100 Unable to do_query: SELECT id,cat,title,bigimage,medsize FROM pp_photos WHERE userid = 5 ORDER BY date DESC LIMIT 0,16<br />Table 'usr_web17_1.pp_photos' doesn't exist<br />Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/www/web17/html/dclan/ubbthreads/mysql.inc.php on line 160<br /><br />Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/web17/html/dclan/ubbthreads/mysql.inc.php on line 133<br /><br />I dont understand why always usr_web17_1 and not usr_web17_4 which is configured in pppanel.php is used. I try to follow your instructions for different databases but I guess I dont understand how to do it correctly. I attach my pppanel.php for a little review. Thanks.
Zarzal <br /> <br /> no / at end <br /> <br />As far as different databases as long as the username and password is the same a simple mysql select datase command right before the query works. <br /> <br />However as Michael pointed out some servers do not like the select database command. <br /> <br />mysql_select_db ("photopost")or die("Could not select database");
Ok, I got it. It seem's there is a misunderstanding. The correct modification for different database and the same user/password look like this:<br /><br />mysql_select_db ("photopostdbnamehere")or die("Could not select database"); <br /><br />$query = "SELECT id,cat,title,bigimage,medsize FROM {$pp_prefix}photos WHERE userid = {$user['U_Number']} ORDER BY date DESC LIMIT $page,16";<br />$result = mysql_query($query);<br />$sth = $dbh -> do_query($query);<br />$numrows = $dbh -> total_rows($sth);<br /><br />if ( $numrows < 16 ) $nextpage = 0;<br /><br />$i=0;<br />$color = "lighttable";<br />$photorow="";<br />$photopanel="";<br /><br />mysql_select_db ("ubbdbnamehere")or die("Could not select database"); <br /><br />the mysql_select_db should not be on top and end of the file. It must be put direct before and after the select. <br /><br />Finished, User Happy <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
me again, sorry <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /> I have a final request. I use Dalans facelift and quickreply. Now I like to move the new box like this:<br /><br /> []http://www.dragonclan-forum.de/move.jpg[/] <br /><br />How I do it ? I m not so good in hacking templates <img src="http://www.ubbdev.com/forum/images/graemlins/frown.gif" alt="" /> All what I can say it must be done in ubbt_instant_ubbcode.tmpl <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /> I hate tables <img src="http://www.ubbdev.com/forum/images/graemlins/crazy.gif" alt="" />
Thank you very much. I needed to change the prefix on the database to nothing on mine but very happy to have this working. <br /><br />Great idea guys and thanks to all that helped create this one.
Thanks, right now I finished it on myself. Du some other modifications and the facelift I encounter some missing tags and fix my template. Thanks anyway.<br /><br />this is a great add on, I like it.
#268409 - 02/04/0401:55 AMRe: Beta-[6.3-6.4] My Photos 1.0
[Re: landyphil]
steelhead
Power User
Registered: 01/14/04
Posts: 99
Loc: Portland, Oregon
Chuck,<br />Ok, I am running seperate batabases with the same passwords.<br />I got this:<br />$data_dir = "http://www.qualityfishing.net/gallery" ;<br /><br />My query now looks like this:<br />}<br />mysql_select_db ("proguide_gallery")or die("Could not select database"); <br />$query = "SELECT id,cat,title,bigimage,medsize FROM {$pp_prefix}photos WHERE userid = {$user['U_Number']} ORDER BY date DESC LIMIT $page,16";<br />$result = mysql_query($query);<br />$sth = $dbh -> do_query($query);<br />$numrows = $dbh -> total_rows($sth);<br /><br />if ( $numrows < 16 ) $nextpage = 0;<br /><br />$i=0;<br />$color = "lighttable";<br />$photorow="";<br />$photopanel="";<br />mysql_select_db ("proguide_forum")or die("Could not select database");<br /><br />I sill get the same error everyone else way getting.<br />So as you told me I added to the top of the file and have this:<br />require ("main.inc.php");<br />// configure your database settings <br />$host = "localhost"; // Vertexhost <br />$user= ""; // ?????? <br />$password= ""; // ????? <br />$database=""; // proguide_gallery or proguide_forum <br /><br /><br />Still the error message. What am I missing??? <img src="http://www.ubbdev.com/forum/images/graemlins/confused.gif" alt="" />
I m not sure if you just post an example with:<br /><br />// configure your database settings <br />$host = "localhost"; // Vertexhost <br />$user= ""; // ?????? <- databaseusername for PP<br />$password= ""; // ????? <- pwd for this user<br />$database=""; // proguide_gallery or proguide_forum <br /><br />but you have to fill it out with your settings. This is needet for my board, running 2 seperatet DB's with the same username and password.<br /><br />sample:<br />$host = "localhost"; // Vertexhost <br />$user= "mydbusername"; // ?????? <- databaseusername for PP<br />$password= "pwdofuser"; // ????? <- pwd for this user<br />$database="proguide_gallery"; // proguide_gallery or proguide_forum <br /><br /><br />after this you need to set the following for creating a first time contact to the PP_DB:<br /><br />// Connecting, selecting database <br />$link = mysql_connect ("$host", "$user", "$password") or die ("I cannot connect to the database."); <br /><br />The rest seems to be correct. Just take my example tha I attach some messages above and edit it to reflect your account settings. It should work.
Steelhead, <br /> <br /> As long as your database supports the mysql_select_db thing you should be able to add the same user permissions from your forum to your gallery database. That would be the easy thing add that mysql user to the proguide_gallery database and then change the query in pppanel.php to this <br /> <br />mysql_select_db ("proguide_gallery")or die("Could not select database"); <br />$query = "SELECT id,cat,title,bigimage,medsize FROM {$pp_prefix}photos WHERE userid = {$user['U_Number']} ORDER BY date DESC LIMIT $page,16"; <br />$result = mysql_query($query); <br />$sth = $dbh -> do_query($query); <br />$numrows = $dbh -> total_rows($sth);
Hi, <br /> <br />It seems that if you have multiple (catagory) folders in your data (picture) directory it doesn't know which one to pick for the users of the board if you put in a /"proper folder" it doesn't work the only way I could get it working was to delete all but the bb users folder and use the path to data without the /. Can this be fixed ? I also had to put the database name in manually in a few places because it was hard coded in, is there a mod for that or is that wat you intended? <br /> <br /> <br /> <br />
Jersey,<br /><br /> You are correct you do not need to place a / at the end. No big deal but what is all this it doesnt know what folder to pick<br /><br /> $imgurl = "[img]{$data_dir}/$ppcat/{$user['U_Number']}{$photo_name}-med{$theext}[/img]"; <br /><br />The above is the default photopost format<br /><br />data/whichcat/usernumberphotonameextention