Mod Name / Version: MyPhotos v2.0 <br /><br />Description: This modification will place a box and link along with the rest of the ubbt_instantcode where a user's photos from photopost will be listed when clicked and they can be inserted into the post with the ubbcode image tag formatted. <br /><br />Working Under: UBB.Threads 6.5 <br /><br />Mod Status: Finished <br /><br />Any pre-requisites: Photopost 5.0 and UBBThreads 6.5 <br /><br />Author(s): Photopost <br /><br />Date: 03/21/05 <br /><br />Credits: MyPhotos updated for Photopost 5 by Omegatron <br /><br />Files Altered: ubbt_instant_ubbcode.tmpl,showflat.tmpl and showthreaded.tmpl<br /> <br /><br />New Files: pppanel.php <br /><br />Database Altered: Nope <br /><br />Info/Instructions: Mod assumes PhotoPost and Threads are installed into same database. If you have them in seperate databases, you will need to use a mysql_select_db() to switch to PP and then back to threads in the pppanel.php file.<br /> <br /><br />Disclaimer: Please backup every file that you intend to modify. <br />If the modification modifies the database, it's a good idea to backup your database before doing so. <br /><br />Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
Registered: 12/07/03
Posts: 131
Loc: Brantford, ON Canada
[]Omegatron said: <br />Info/Instructions: Mod assumes PhotoPost and Threads are installed into same database. If you have them in seperate databases, you will need to use a mysql_select_db() to switch to PP and then back to threads in the pppanel.php file.[/] <br /> <br />Hi Omegatron, <br /> <br />I have Threads and Photopost using their own separate databases (database names, ie: fa_threads & fa_photopost), and both programs are installed in different folders on the server (ie: www.flightattendants.org/ubbthreads/ ... and ... www.flightattendants.org/photopost/ ... <br /> <br />I've installed the mod, but don't understand where to make the appropriate changes in pppanel.php. When I click on "Insert My Photos Into Post" I get the could not select database error message. <br /> <br />This is how I've currently got it set up in pppanel.php: <br /> <br />//Connecting, selecting database <br />$link = mysql_connect ("$host", "$user", "$password") or die ('I cannot connect to the database.'); <br />mysql_select_db ("mysql_connect")or die("Could not select database. This feature has not yet been enabled. Please try again later."); <br /> <br /> <br />require ("/includes/main.inc.php"); <br /> <br /> <br />$pp_prefix=""; <br /> <br />$data_dir = "http://www.flightattendants.org/photopost/data/" ; <br /> <br />....and at the bottom I uncommented the mysql line as instructed. <br /> <br />Thanks for any advice you can offer! <br /> <br />Jason <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
I'm not Omegatron but I try to help <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /> You have to edit the pppanel.php. On top you find:<br /><br />// configure your database settings <br />$host = "ip or dnsname of host for pp"; // Server Name <br />$user= "username for pp db"; // Username <br />$password= "password for pp db"; // Password <br />$database="databasename of pp db"; // Photopost database name or forum database name <br /><br />// Connecting, selecting database <br />$link = mysql_connect ("$host", "$user", "$password") or die ("I cannot connect to the database."); <br />//mysql_select_db ("$database")or die("Could not select database");<br /><br />require ("./includes/main.inc.php");<br /><br />$pp_prefix="pp_";<br />$data_dir = "http://insert your url here/photopost/data" ; //URL of your photo dir where those jpeg stored (with n<br /><br />### search for:<br />else {<br /> $nextpage = $page + 1;<br /> if ( $page > 1 ) $prevpage = $page - 1;<br /> else $prevpage = 0;<br /> <br /> $page = ($page*16);<br />}<br /><br />### insert under it:<br />mysql_select_db ("name of your PP DB here")or die("Could not select database"); <br /><br />### now, search for the following:<br />$i=0;<br />$color = "lighttable";<br />$photorow="";<br />$photopanel="";<br /><br /><br />### under it insert:<br /><br />mysql_select_db ("name of your THREADS db here")or die("Could not select database");<br /><br />on bottom of the file you have:<br />//mysql_select_db ("UBBTHREADSDATABASE")or die("Could not select database");<br /><br />leave it with // or delete the line.<br /><br />It should work now.
Registered: 12/07/03
Posts: 131
Loc: Brantford, ON Canada
[]Zarzal said: <br />I'm not Omegatron but I try to help <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /> You have to edit the pppanel.php. On top you find: <br /> <br />// configure your database settings <br />$host = "ip or dnsname of host for pp"; // Server Name <br />$user= "username for pp db"; // Username <br />$password= "password for pp db"; // Password <br />$database="databasename of pp db"; // Photopost database name or forum database name [/] <br /> <br />Thanks for your input, Zarzal. Unfortunately I still wasn't able to get it working. <br /> <br />// configure your database settings <br />$host = "here I inserted localhost"; // Server Name <br />$user= "here I inserted my PP_db username"; // Username <br />$password= "I inserted my PP db password"; // Password <br />$database="I inserted my PP_database name"; // Photopost database name or forum database name <br /> <br />Under: <br /> <br />$i=0; <br />$color = "lighttable"; <br />$photorow=""; <br />$photopanel=""; <br /> <br />...I added: <br /> <br />mysql_select_db ("I added my threads_database name here")or die("Could not select database"); <br /> <br />...and commented out on the last lines: <br />//mysql_select_db ("UBBTHREADSDATABASE")or die("Could not select database"); <br /> <br />I still get the could not select database error message. <br /> <br />Am I missing something else? <br /> <br />Sorry for not getting it, but thanks for your help! <br /> <br />Jason <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
Registered: 12/07/03
Posts: 131
Loc: Brantford, ON Canada
Nope, I hadn't... thanks for pointing that out! <br /> <br />Unfortunately I still get the same error message: <br /> <br />"Could not select database. This feature has not yet been enabled. Please try again later." <br /> <br />I customised the message in: <br /> <br />//Connecting, selecting database <br />$link = mysql_connect ("$host", "$user", "$password") or die ('I cannot connect to the database.'); <br />mysql_select_db ("mysql_connect")or die("Could not select database. This feature has not yet been enabled. Please try again later."); <br /> <br />require ("./includes/main.inc.php"); <br /> <br />...so it would appear it's not making it past: <br /> <br />// configure your database settings <br />$host = "LOCALHOST"// Server Name (in lowercase) <br />$user= "PHOTOPOST DATABASE USERNAME"; // Username <br />$password= "PHOTOPOST DATABASE PASSWORD"; // Password <br />$database="PHOTOPOST DATABASE NAME"; // Photopost database name or forum database name <br /> <br />...also, in: <br /> <br />$database="PHOTOPOST DATABASE NAME"; // Photopost database name or forum database name <br /> <br />...I tried inserting my THREADS DATABASE NAME, but that didn't work either. My password for both threads and photopost databases are the same, so it can't be that either. <br /> <br />Any ideas, Zarzal? Thanks! <br /> <br />Jason <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" />
[]//Connecting, selecting database<br />$link = mysql_connect ("$host", "$user", "$password") or die ('I cannot connect to the database.');<br />mysql_select_db ("mysql_connect")or die("Could not select database. This feature has not yet been enabled. Please try again later.");<br />[/]<br /><br />Thats wrong <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /> mysql_select_db ("mysql_connect".... <br /><br />I append my script here, just modify it for your settings. I have done some little modifications.
Registered: 12/07/03
Posts: 131
Loc: Brantford, ON Canada
Sorry, I hadn't noticed you had a download in your post. <br /> <br />Okay, it's making it further, but now the script won't go past line 89 - cause I don't know what to put in there. <br /> <br />mysql_select_db ($database)or die("Could not select database"); // switch to PP DB <br /> <br />Do I manually enter my PP database name on this line? I thought $database would pull it from the $database value I entered at the top of the script. No? <br /> <br />Also, if you are not using a database prefix (i.e. pp_), do you enter "0" or just leave it blank between the ""'s? <br /> <br />Sorry to be such a pain & thanks very much for your help, <br /> <br />Jason
[]mysql_select_db ($database)or die("Could not select database"); // switch to PP DB<br /><br />Do I manually enter my PP database name on this line? I thought $database would pull it from the $database value I entered at the top of the script. No?[/]<br /><br />this should pull the dbname that you entered on top in the script. You can try to enter here your dbname in (" ")<br /><br />[]Also, if you are not using a database prefix (i.e. pp_), do you enter "0" or just leave it blank between the ""'s?[/]<br /><br />Sorry, I dont know this. you have to try it. I guess its "" if you are using no prefix.
Registered: 12/07/03
Posts: 131
Loc: Brantford, ON Canada
Zaral, <br /> <br />hmmm I did try your suggestion but again met a brick wall. Oh well, it was a good thought to try and get it working. It's not for lack of trying that I can't get this mod to work. Thanks again very much, you've been very helpful. <br /> <br />Jason <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
to running pppanel under threads 6.5.x you need to modify it. In line 63 you find:<br />require ("$thispath/languages/$ubbt_language/instant_markup.php");<br /><br />replace with:<br />require ("languages/{$_SESSION['myprefs']['language']}/instant_markup.php");