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.
Working Under: UBB.Threads 6.5
Mod Status: Finished
Any pre-requisites: Photopost 5.0 and UBBThreads 6.5
Author(s): Photopost
Date: 03/21/05
Credits: MyPhotos updated for Photopost 5 by Omegatron
Files Altered: ubbt_instant_ubbcode.tmpl,showflat.tmpl and showthreaded.tmpl
New Files: pppanel.php
Database Altered: Nope
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.
Disclaimer: Please backup every file that you intend to modify. If the modification modifies the database, it's a good idea to backup your database before doing so.
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.
[]Omegatron said: 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.[/]
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.
This is how I've currently got it set up in pppanel.php:
//Connecting, selecting database $link = mysql_connect ("$host", "$user", "$password") or die ('I cannot connect to the database.'); mysql_select_db ("mysql_connect")or die("Could not select database. This feature has not yet been enabled. Please try again later.");
I'm not Omegatron but I try to help You have to edit the pppanel.php. On top you find:
// configure your database settings $host = "ip or dnsname of host for pp"; // Server Name $user= "username for pp db"; // Username $password= "password for pp db"; // Password $database="databasename of pp db"; // Photopost database name or forum database name
// Connecting, selecting database $link = mysql_connect ("$host", "$user", "$password") or die ("I cannot connect to the database."); //mysql_select_db ("$database")or die("Could not select database");
require ("./includes/main.inc.php");
$pp_prefix="pp_"; $data_dir = "http://insert your url here/photopost/data" ; //URL of your photo dir where those jpeg stored (with n
[]Zarzal said: I'm not Omegatron but I try to help You have to edit the pppanel.php. On top you find:
// configure your database settings $host = "ip or dnsname of host for pp"; // Server Name $user= "username for pp db"; // Username $password= "password for pp db"; // Password $database="databasename of pp db"; // Photopost database name or forum database name [/]
Thanks for your input, Zarzal. Unfortunately I still wasn't able to get it working.
// configure your database settings $host = "here I inserted localhost"; // Server Name $user= "here I inserted my PP_db username"; // Username $password= "I inserted my PP db password"; // Password $database="I inserted my PP_database name"; // Photopost database name or forum database name
"Could not select database. This feature has not yet been enabled. Please try again later."
I customised the message in:
//Connecting, selecting database $link = mysql_connect ("$host", "$user", "$password") or die ('I cannot connect to the database.'); mysql_select_db ("mysql_connect")or die("Could not select database. This feature has not yet been enabled. Please try again later.");
require ("./includes/main.inc.php");
...so it would appear it's not making it past:
// configure your database settings $host = "LOCALHOST"// Server Name (in lowercase) $user= "PHOTOPOST DATABASE USERNAME"; // Username $password= "PHOTOPOST DATABASE PASSWORD"; // Password $database="PHOTOPOST DATABASE NAME"; // Photopost database name or forum database name
...also, in:
$database="PHOTOPOST DATABASE NAME"; // Photopost database name or forum database name
...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.
[]//Connecting, selecting database $link = mysql_connect ("$host", "$user", "$password") or die ('I cannot connect to the database.'); mysql_select_db ("mysql_connect")or die("Could not select database. This feature has not yet been enabled. Please try again later."); [/]
Thats wrong mysql_select_db ("mysql_connect"....
I append my script here, just modify it for your settings. I have done some little modifications.
Sorry, I hadn't noticed you had a download in your post.
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.
mysql_select_db ($database)or die("Could not select database"); // switch to PP DB
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?
Also, if you are not using a database prefix (i.e. pp_), do you enter "0" or just leave it blank between the ""'s?
Sorry to be such a pain & thanks very much for your help,
[]mysql_select_db ($database)or die("Could not select database"); // switch to PP DB
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?[/]
this should pull the dbname that you entered on top in the script. You can try to enter here your dbname in (" ")
[]Also, if you are not using a database prefix (i.e. pp_), do you enter "0" or just leave it blank between the ""'s?[/]
Sorry, I dont know this. you have to try it. I guess its "" if you are using no prefix.
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.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.