Previous Thread
Next Thread
Print Thread
Rate Thread
#284369 03/21/2005 4:05 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
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.
Attachments
126475-myphotos.zip (0 Bytes, 251 downloads)

Sponsored Links
Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
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="" />";

Joined: Dec 2003
Posts: 123
Junior Member
Junior Member
Offline
Joined: Dec 2003
Posts: 123
[]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

Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
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.

Joined: Dec 2003
Posts: 123
Junior Member
Junior Member
Offline
Joined: Dec 2003
Posts: 123
[]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

Sponsored Links
Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
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");

Joined: Dec 2003
Posts: 123
Junior Member
Junior Member
Offline
Joined: Dec 2003
Posts: 123
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

Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
[]//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.
Attachments
126514-pppanel.php.txt (0 Bytes, 149 downloads)

Joined: Dec 2003
Posts: 123
Junior Member
Junior Member
Offline
Joined: Dec 2003
Posts: 123
Sorry, I don't follow what you mean. What am I supposed to change?

Thanks,

Jason

Joined: Dec 2003
Posts: 123
Junior Member
Junior Member
Offline
Joined: Dec 2003
Posts: 123
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

Sponsored Links
Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
[]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.

Joined: Dec 2003
Posts: 123
Junior Member
Junior Member
Offline
Joined: Dec 2003
Posts: 123
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

Joined: Feb 2005
Posts: 4
Lurker
Lurker
Offline
Joined: Feb 2005
Posts: 4
where can I see an example of this working?

Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
to running pppanel under threads 6.5.x you need to modify it. In line 63 you find:
require ("$thispath/languages/$ubbt_language/instant_markup.php");

replace with:
require ("languages/{$_SESSION['myprefs']['language']}/instant_markup.php");

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
thanks zarzal


- Allen wavey
- What Drives You?

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)