Omegatron
Pooh-Bah
  
Reged: 03/07/02
Posts: 3173
Loc: Abingdon,Maryland
|
|
Mod Name / Version: MyPhotos v2.0
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.
|
Zarzal
Enthusiast
   
Reged: 03/30/03
Posts: 437
Loc: Berlin, Germany
|
|
litte bugfix.
search for: $mthumb = "<img border=\"0\" src=\"{$data_dir}/{$ppcat}/{$user['U_Number']}{$photo_name}-thumb{$theext}\" alt=\"\" />";
replace with: $mthumb = "<img border=\"0\" src=\"{$data_dir}/{$ppcat}/thumbs/{$photo}\" alt=\"\" />";
|
JayDee
Journeyman
Reged: 12/03/03
Posts: 129
Loc: Canada
|
|
Quote:
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.
Hi Omegatron,
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/ ...
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.");
require ("/includes/main.inc.php");
$pp_prefix="";
$data_dir = "http://www.flightattendants.org/photopost/data/" ;
....and at the bottom I uncommented the mysql line as instructed.
Thanks for any advice you can offer!
Jason
-------------------- "Always remember you're unique ...just like everybody else."
|
Zarzal
Enthusiast
   
Reged: 03/30/03
Posts: 437
Loc: Berlin, Germany
|
|
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
### search for: else { $nextpage = $page + 1; if ( $page > 1 ) $prevpage = $page - 1; else $prevpage = 0; $page = ($page*16); }
### insert under it: mysql_select_db ("name of your PP DB here")or die("Could not select database");
### now, search for the following: $i=0; $color = "lighttable"; $photorow=""; $photopanel="";
### under it insert:
mysql_select_db ("name of your THREADS db here")or die("Could not select database");
on bottom of the file you have: //mysql_select_db ("UBBTHREADSDATABASE")or die("Could not select database");
leave it with // or delete the line.
It should work now.
|
JayDee
Journeyman
Reged: 12/03/03
Posts: 129
Loc: Canada
|
|
Quote:
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
Under:
$i=0;
$color = "lighttable";
$photorow="";
$photopanel="";
...I added:
mysql_select_db ("I added my threads_database name here")or die("Could not select database");
...and commented out on the last lines:
//mysql_select_db ("UBBTHREADSDATABASE")or die("Could not select database");
I still get the could not select database error message.
Am I missing something else?
Sorry for not getting it, but thanks for your help!
Jason
|
Zarzal
Enthusiast
   
Reged: 03/30/03
Posts: 437
Loc: Berlin, Germany
|
|
have you done this too:
### search for: else { $nextpage = $page + 1; if ( $page > 1 ) $prevpage = $page - 1; else $prevpage = 0;
$page = ($page*16); }
### insert under it: mysql_select_db ("name of your PP DB here")or die("Could not select database");
|
JayDee
Journeyman
Reged: 12/03/03
Posts: 129
Loc: Canada
|
|
Nope, I hadn't... thanks for pointing that out!
Unfortunately I still get the same error message:
"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.
Any ideas, Zarzal? Thanks!
Jason
-------------------- "Always remember you're unique ...just like everybody else."
|
Zarzal
Enthusiast
   
Reged: 03/30/03
Posts: 437
Loc: Berlin, Germany
|
|
Quote:
//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.
|
JayDee
Journeyman
Reged: 12/03/03
Posts: 129
Loc: Canada
|
|
Sorry, I don't follow what you mean. What am I supposed to change?
Thanks,
Jason
-------------------- "Always remember you're unique ...just like everybody else."
|
JayDee
Journeyman
Reged: 12/03/03
Posts: 129
Loc: Canada
|
|
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,
Jason
-------------------- "Always remember you're unique ...just like everybody else."
|
Zarzal
Enthusiast
   
Reged: 03/30/03
Posts: 437
Loc: Berlin, Germany
|
|
Quote:
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 (" ")
Quote:
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.
|
JayDee
Journeyman
Reged: 12/03/03
Posts: 129
Loc: Canada
|
|
Zaral,
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.
Jason
-------------------- "Always remember you're unique ...just like everybody else."
|
fishtails
Enthusiast
   
Reged: 06/19/02
Posts: 308
Loc: Fernandina Beach, FL
|
|
I upgraded my photopost to 5.14 from 4.8 the other day. Noticed that the myphotos needed correcting. Little did I realize until investigating some complaints about broken photos that when I upgraded to 5.14, all my images which were -med.jpg or -thumb.jpg disappeared and were moved/renamed into a mediums and thumbs directory. Ok, that's good, but now I have broken images all over the place in my forums from because now there is no -med or-thumb! I looked up one of the posts in phpmysql and removed the -med from the image url. That fixed the problem for one post. Problem is, there's over 10,000 posts ! I was wondering if anyone could help me construct a query to update my image links. I've already purchased fusionbb and was getting ready to import my data and hook up photopost, but now I'm delayed due to this huge problem. This looks like a complicated query and I'm not sure of where to start.
Thanks for any help.
-------------------- Fish or Cut Bait! http://www.fish-tails.net
Air traffic control? It has its ups and downs. http://www.natcazjx.org
|
fishtails
Enthusiast
   
Reged: 06/19/02
Posts: 308
Loc: Fernandina Beach, FL
|
|
Never mind. I downloaded a dump and used a text editor to search and replace, then re-uploaded it. Thanks anyway.
One thing to note on the config though: where you have the instructions:
Code:
$data_dir = "http://www.domain.com/photopost/data/" ; //URL of your photo dir where those jpeg stored (with / at end)
if you add a trailing slash then the url ends up looking like this with two slashes between data and the dir.
Code:
http://www.fish-tails.net/photopost/data//500/medium/2IMG_0012.JPG
O left out the trailing slash and the url is correct now.
Thanks again.
-------------------- Fish or Cut Bait! http://www.fish-tails.net
Air traffic control? It has its ups and downs. http://www.natcazjx.org
|