UBB.Dev
Posted By: omegatron Beta-[6.3-6.4] My Photos 1.0 - 01/29/2004 5:01 PM
Mod Name / Version: My Photos 1.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.3-6.4

Mod Status: Beta

Any pre-requisites:

Author(s): Photopost ( Michael Pierce )

Date: 01/29/04

Credits:

Files Altered: ubbt_instant_ubbcode.tmpl,showflat.tmpl and showthreaded.tmpl

New Files: pppanel.php

Database Altered: None

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.

Something like this

// configure your database settings
$host = "localhost"; // Server Name
$user= ""; // Username
$password= ""; // Password
$database=""; // 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");

and then after the queries etc bottom of file something like this

mysql_select_db ("UBBTHREADSDATABASE")or die("Could not select database");


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.


Attached File
106674-myphotos.zip  (322 downloads)
Posted By: PhotoPost Re: Beta-[6.3-6.4] My Photos 1.0 - 01/29/2004 6:01 PM
Here is a screen shot of what it looks like.

Attached picture 106678-pppanel.jpg
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/29/2004 10:06 PM
Closer view 1

Attached picture 106683-view.gif
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/29/2004 10:08 PM
Closer view 2 ----The Panel Itself

Attached picture 106684-Image3.gif
Posted By: donJulio Re: Beta-[6.3-6.4] My Photos 1.0 - 01/29/2004 11:32 PM
That is beautiful! I'll be installing this when I get home. Awesome work!
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 12:16 AM
What else would you expect from the master of Photopost himself Michael Pierce.
Posted By: fishtails Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 2:49 AM
Well, I must say I'm glad I brought the subject up! Just kidding. This is what I was talking about in the other thread, for the most part. The only thing missing is an upload, not that it's that important, but if one could upload to their gallery from this panel would be excellent. Not that it's not excellent as it is! yada yada yada Slap me and make me shut up will ya!

Thanks guys!
Posted By: gblue Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 3:59 AM
Chuck,

I started to install this mod but I saw in the instructions

the following is applicable if you have the quick reply mod installed

Does that mean if I dont have quick mod installed it wont work ? or I just dont need to edit the other files ?
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 4:24 AM
[]Now the following is applicable if you have the quick reply mod installed if you do not there is no need to continue.[/]

Just as it says. If you do not have quick reply installed your done.
Posted By: Sky YYZ Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 5:53 AM
Hey Chuck,

Great Mod!!! Unfortunately, I get this... any ideas?

SQL ERROR: Thu, Jan 29 2004 22:51:15 -0500 Unable to do_query: SELECT id,cat,title,bigimage,medsize FROM pp_photos WHERE userid = 4 ORDER BY date DESC LIMIT 0,16
Table 'flighta_thread.pp_photos' doesn't exist
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/flighta/public_html/ubbthreads/mysql.inc.php on line 160

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/flighta/public_html/ubbthreads/mysql.inc.php on line 133
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 2:38 PM
Is the Photopost database along with Threads or on its own?

If not then read the first post in this thread

Is your prefix for the photopost database set?
Posted By: gblue Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 3:20 PM
Never mind.. I took it off ! You did not answer the question. I am not a programmer.
You said Just as it says. If you do not have quick reply installed your done.

So does that mean the MOD is complete ? Or it wont work unless you have quick reply installed. If so why not say so at the top of the page

Just call me dense I guess.
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 5:22 PM
Okay Lets take this one step at a time cause your getting confused here. I answered your question.

1. You edit your ubbt_instant_ubbcode.tmpl this puts a link in your newpost and newreply pages to the java 7photo panel.

2. The directions state that if you have the quick reply mod there is some extra steps OTHERWISE your done. If you are not familiar with the quick reply mod it adds a quick reply box on your showflat and showthreaded screens. This has a link to the graemlin panel and if you do the other steps in this mod will also add a MY PHOTOS link so users can use this mod there as well. However just as the instructions state if you do not have quick reply installed your done.

Do you understand? Just as it says if you do not have quick reply installed your DONE.

You only need to modify the one file ubbt_instant_ubbcode.tmpl
Posted By: gblue Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 5:36 PM
Got it Thank you .
Posted By: gblue Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 6:50 PM
Chuck,

Ok got the mod installed but I am getting the same error as the guy posted above. Per your post above my ubbthreads and photopost share the same database. The prefix was not set in PhotoPost so I set it to what I have in Ubbt w3t_

I have my datapath set to http://xxxxx/PhotoPost/data

See anything wrong with the way I have it setup ?



SQL ERROR: Unable to do_query: SELECT id,cat,title,bigimage,medsize FROM pp_photos WHERE userid = 2 ORDER BY date DESC LIMIT 0,16
Table 'ubbthreads.pp_photos' doesn't exist
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/html/ubbthreads/mysql.inc.php on line 160

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/ubbthreads/mysql.inc.php on line 133
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 6:55 PM
OKay redownload and upload the pppanel.php again.

I made a change to the modification but forgot to upload the change I made.

It was hardcoded to the pp_ prefix

Now in the beginning of the file there is a spot to set the Photopost prefix


$pp_prefix="";
Posted By: gblue Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 7:05 PM
Works like a charm Thanks
Posted By: AllenAyres Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 8:43 PM
great work chuck and michael
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 9:24 PM
Great Work Michael! I am just helping out by documenting install instructions.
Posted By: smilesforu Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 9:29 PM
ok trying to add this in using a separate database put in the line
$query = "SELECT id,cat,title,bigimage,medsize FROM {$pp_prefix}photos WHERE userid = {$user['U_Number']} ORDER BY date DESC LIMIT $page,16";
$result = mysql_query($query);
$sth = $dbh -> do_query($query);
mysql_select_db ("threads")or die("Could not select database");


This is the error I get
SQL ERROR: Database error only visible to forum administrators

Warning: Supplied argument is not a valid MySQL result resource in /home2/www/steelheader/ubbthreads/mysql.inc.php on line 133
SQL ERROR: Database error only visible to forum administrators

Warning: Supplied argument is not a valid MySQL result resource in /home2/www/steelheader/ubbthreads/mysql.inc.php on line 160

Warning: Supplied argument is not a valid MySQL result resource in /home2/www/steelheader/ubbthreads/mysql.inc.php on line 133
Posted By: donJulio Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 9:41 PM
I haven't used this yet, but does it allow me to browse the photo categories to find photos quicker? I have 50 galleries and some users have hundreds of photos. So any way to browse the photos quicker would be cool. Also it would be cool if they could use any photo in this. What I mean is not just thier photos (that they themselves have uploaded to their member galleries or public galleries), but all photos in their personal gallery (not other members galleries) and all photos in the public galleries, regardless of who posted them.
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 10:02 PM
Steelhead

At the top of that file you need to have the information to connect to photopost database. Try putting the select threads database at the bottom of the file or try it without it since it operates in another window.

Don Julio

This mod only pulls your photo's however if you look at the query I am sure you can adjust things to your liking. I beleive the default is ORDER BY date DESC
Posted By: smilesforu Re: Beta-[6.3-6.4] My Photos 1.0 - 01/30/2004 10:14 PM
Chuck ... I tried with out and with it at bottom.. no luck
I have the database stuff at the top.

BTW steelhead is the other guy, but I knew you meant me
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 12:29 AM
Marty,

Ok If the username and password to access the first database are the same you can just put this before the query in pppanel.php

mysql_select_db ("DATABASENAME")or die("Could not select database");
Posted By: smilesforu Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 12:53 AM
is the database named changed to match my sites? If so I got errors again.

SQL ERROR: Database error only visible to forum administrators

Warning: Supplied argument is not a valid MySQL result resource in /home2/www/steelheader/ubbthreads/mysql.inc.php on line 133
SQL ERROR: Database error only visible to forum administrators

Warning: Supplied argument is not a valid MySQL result resource in /home2/www/steelheader/ubbthreads/mysql.inc.php on line 160

Warning: Supplied argument is not a valid MySQL result resource in /home2/www/steelheader/ubbthreads/mysql.inc.php on line 133
Posted By: PhotoPost Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 1:13 AM
You have to reselect your Threads database at the bottom.
Posted By: Zarzal Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 1:35 AM
It seems, that many people have trouble with the databaseswitching. It would be fine to put another modified file in your archiv with sample settings for people who have installed in seperate default databases.
Posted By: smoknz28 Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 9:03 AM
Chuck, this looks like an awesome hack and I'm trying to get it implemented.

I'm running into an issue with this hack however and I'm sure it's something simple.

- A user clicks on post or reply.
- User clicks on the "Insert My Photos into Post"
- The users is shown the infamous red x with boxes that are suppose to show his/her photos.

I did not continue hacking into the showflat.tmpl or showthreaded.tmpl files as I don't use the quick reply hack.

Also, I'm assuming I'm to upload the pppanel.php file into the ubbthreads directory.

Now, a little background.

I'm running two seperate databases. One for my ubbthreads and one for the photopost.

I added the same user from ubbthreads to my photopost database. So that the same user can share the database.

I've tried following some of the thread here, but get a bit lost.

Any help on this is greatly appreciated.

[]http://members.cox.net/gonzo_family/misc/myphotos_error.gif[/]
Posted By: smoknz28 Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 9:16 AM
I've added this code as I read above:

// Selecting the PhotoPost Database
[:"red"]mysql_select_db ("smoknz28_photopost")or die("Could not select database");[/]

$query = "SELECT id,cat,title,bigimage,medsize FROM {$pp_prefix}photos WHERE userid = {$user['U_Number']} ORDER BY date DESC LIMIT $page,16";
$result = mysql_query($query);
$sth = $dbh -> do_query($query);
$numrows = $dbh -> total_rows($sth);


But I'm having the same results.
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 12:54 PM
What is this setting?

$data_dir="";
Posted By: fishtails Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 5:59 PM
I'm just curious. Could the js for the photopanel conflict with the js for the font colors? My font colors no longer render on the posting form. Example here.
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 6:05 PM
Anything is possible.

However I would double check your hacking first.

There are multiple instances of defined functions under that script call and the only thing broken is your colors.
Posted By: smoknz28 Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 7:25 PM
[]Omegatron said:
What is this setting?

$data_dir=""; [/]

Yea, I was a bit confused on this one as I wasn't sure where I should point this to as the jpeg files are stored in seperate subdirectories off of the data directory.

$data_dir = "http://www.f-bodyhideout.com/gallery/data/" ; //URL of your photo dir where those jpeg stored (with / at end)
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 7:34 PM
Well there is your problem. Your data path is not correct

I view one of your thumbs and get this as your data path

http://www.f-bodyhideout.com/ubbthreads/gallery/data/
Posted By: smoknz28 Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 7:42 PM
Duhhhh....damn, do you ever get tired of dealing with knuckle-heads like me??
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 7:52 PM
I just smile a bit thats all
Posted By: smoknz28 Re: Beta-[6.3-6.4] My Photos 1.0 - 01/31/2004 8:27 PM
Posted By: fishtails Re: Beta-[6.3-6.4] My Photos 1.0 - 02/01/2004 12:24 AM
I'll check my hacking. On another note, if you are not logged in and click the My Photos, it throws mysql errors because there's no unumber. So, there needs to be a check for valid user so it doesn't throw the errors. But, awesome hack at any rate. Thanks for the hack Michael.
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 02/01/2004 2:44 AM
Do you allow anonymous posting?

Just checking cause if you have quick reply mod installed and you have no right to post thus the quick reply does not show so the my photos link would not work

Also in your posting screens if you have no photos it says you have no photos

So I am assuming that you allow anonymous posting?
Posted By: fishtails Re: Beta-[6.3-6.4] My Photos 1.0 - 02/01/2004 3:30 AM
Yes, I do allow anonymous posts of messages, but not uploading of any sort. I don't use the quick reply and thus don't have it installed. Yes, it does say that you have no photos, but not until it throws out the mysql errors when not logged in.
Posted By: smoknz28 Re: Beta-[6.3-6.4] My Photos 1.0 - 02/01/2004 4:35 AM
Michael and Chuck, good job on this hack!

I've had a few good PMs come through from my site letting me know what a nice addition we've made.

No bugs to report at this time under v6.4
Posted By: Zarzal Re: Beta-[6.3-6.4] My Photos 1.0 - 02/01/2004 1:16 PM
Omeatron, in your instruction you write:
$data_dir = "http://www.reeftalk.com/photos" ; //URL of your photo dir where those jpeg stored (with no / at end)

in your ppanel.php you write:
//URL of your photo dir where those jpeg stored (with / at end)

Which is correct ?
Posted By: Zarzal Re: Beta-[6.3-6.4] My Photos 1.0 - 02/01/2004 1:55 PM
I don't bring this hack to work

I also get this error:

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
Table 'usr_web17_1.pp_photos' doesn't exist
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

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

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.

Attached File
106907-pppanel.txt  (296 downloads)
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 02/01/2004 5:01 PM
Zarzal

no / at end

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.

However as Michael pointed out some servers do not like the select database command.

mysql_select_db ("photopost")or die("Could not select database");
Posted By: Zarzal Re: Beta-[6.3-6.4] My Photos 1.0 - 02/01/2004 11:22 PM
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:

mysql_select_db ("photopostdbnamehere")or die("Could not select database");

$query = "SELECT id,cat,title,bigimage,medsize FROM {$pp_prefix}photos WHERE userid = {$user['U_Number']} ORDER BY date DESC LIMIT $page,16";
$result = mysql_query($query);
$sth = $dbh -> do_query($query);
$numrows = $dbh -> total_rows($sth);

if ( $numrows < 16 ) $nextpage = 0;

$i=0;
$color = "lighttable";
$photorow="";
$photopanel="";

mysql_select_db ("ubbdbnamehere")or die("Could not select database");

the mysql_select_db should not be on top and end of the file. It must be put direct before and after the select.

Finished, User Happy
Posted By: Zarzal Re: Beta-[6.3-6.4] My Photos 1.0 - 02/01/2004 11:32 PM
me again, sorry I have a final request. I use Dalans facelift and quickreply. Now I like to move the new box like this:

[]http://www.dragonclan-forum.de/move.jpg[/]

How I do it ? I m not so good in hacking templates All what I can say it must be done in ubbt_instant_ubbcode.tmpl I hate tables
Posted By: smilesforu Re: Beta-[6.3-6.4] My Photos 1.0 - 02/01/2004 11:50 PM
Zarzal could you post a attachment of updated file.. please.
Thanks
Posted By: Zarzal Re: Beta-[6.3-6.4] My Photos 1.0 - 02/02/2004 12:03 AM
here it comes ... just rename to .php and edit the dbmanes inside

Attached File
106929-pppanel.txt  (95 downloads)
Posted By: smilesforu Re: Beta-[6.3-6.4] My Photos 1.0 - 02/02/2004 6:26 AM
Thank you very much. I needed to change the prefix on the database to nothing on mine but very happy to have this working.

Great idea guys and thanks to all that helped create this one.
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 02/02/2004 6:00 PM
Zarzal have you modified the html to show the box where you want?

Intead of this that I say

<br />
<table width="350" cellpadding="1" cellspacing="1" class="tablesurround">
<tr>
<td>
<table cellpadding="4" cellspacing="1" width="100%" class="tableborders">
<tr>
<td valign="top" class="tdheader">
<center><b>Photos</b>
</td>
</tr>
<td align="center" class="lighttable">
<br /><a href="javascript:void(0)" onclick="openPhotoPanel()">Insert My Photos into Post</a><br /><br />
</td>
</tr>
</table>
</td>
</tr>
</table>

In the instant ubbcode template

Do something like this

Find this:

<table border="0"><tr><td class="tdheader">
<b>{$ubbt_lang['INST_GRAEMLIN']}</b>
</td>
<td valign="top" class="tdheader">
<b>{$ubbt_lang['INST_UBB']}</b>
</td>
<td valign="top" class="tdheader">
<b>{$ubbt_lang['FONT_COLOR']}</b>
</td>
</tr>

Change it to this:

<table border="0"><tr><td class="tdheader">
<b>{$ubbt_lang['INST_GRAEMLIN']}</b>
</td>
<td valign="top" class="tdheader">
<b>{$ubbt_lang['INST_UBB']}</b>
</td>
<td valign="top" class="tdheader">
<b>{$ubbt_lang['FONT_COLOR']}</b>
</td>
<td valign="top" class="tdheader">
<center><b>Photos</b>
</td>
</tr>

Then find this:

</table>
</td>
</tr>
</table>

and replace it with something like this:

</table>
</td>
<td valign="top">
<table border="1">
<tr>
<td align="center" class="lighttable">
<br /><a href="javascript:void(0)" onclick="openPhotoPanel()">Insert My Photos into Post</a><br /><br />
</td>
</tr>
</table>
</td>
</tr>
</table>
Posted By: Zarzal Re: Beta-[6.3-6.4] My Photos 1.0 - 02/02/2004 6:03 PM
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.

this is a great add on, I like it.
Posted By: Anno Re: Beta-[6.3-6.4] My Photos 1.0 - 02/02/2004 9:11 PM
Zarzal, Photos, NOT Photo's ......
Posted By: Zarzal Re: Beta-[6.3-6.4] My Photos 1.0 - 02/03/2004 12:24 AM
That's the original text from Omegatron But I see he change it.
Posted By: steelhead Re: Beta-[6.3-6.4] My Photos 1.0 - 02/04/2004 9:55 AM
Chuck,
Ok, I am running seperate batabases with the same passwords.
I got this:
$data_dir = "http://www.qualityfishing.net/gallery" ;

My query now looks like this:
}
mysql_select_db ("proguide_gallery")or die("Could not select database");
$query = "SELECT id,cat,title,bigimage,medsize FROM {$pp_prefix}photos WHERE userid = {$user['U_Number']} ORDER BY date DESC LIMIT $page,16";
$result = mysql_query($query);
$sth = $dbh -> do_query($query);
$numrows = $dbh -> total_rows($sth);

if ( $numrows < 16 ) $nextpage = 0;

$i=0;
$color = "lighttable";
$photorow="";
$photopanel="";
mysql_select_db ("proguide_forum")or die("Could not select database");

I sill get the same error everyone else way getting.
So as you told me I added to the top of the file and have this:
require ("main.inc.php");
// configure your database settings
$host = "localhost"; // Vertexhost
$user= ""; // ??????
$password= ""; // ?????
$database=""; // proguide_gallery or proguide_forum


Still the error message. What am I missing???
Posted By: Zarzal Re: Beta-[6.3-6.4] My Photos 1.0 - 02/04/2004 10:46 AM
I m not sure if you just post an example with:

// configure your database settings
$host = "localhost"; // Vertexhost
$user= ""; // ?????? <- databaseusername for PP
$password= ""; // ????? <- pwd for this user
$database=""; // proguide_gallery or proguide_forum

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.

sample:
$host = "localhost"; // Vertexhost
$user= "mydbusername"; // ?????? <- databaseusername for PP
$password= "pwdofuser"; // ????? <- pwd for this user
$database="proguide_gallery"; // proguide_gallery or proguide_forum


after this you need to set the following for creating a first time contact to the PP_DB:

// Connecting, selecting database
$link = mysql_connect ("$host", "$user", "$password") or die ("I cannot connect to the database.");

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.
Posted By: steelhead Re: Beta-[6.3-6.4] My Photos 1.0 - 02/04/2004 11:22 AM
yep, I have it as this:

$host = "localhost"; //
$user= "thisismydbusername"; //
$password= "thisismydbpassword"; //
$database="proguide_gallery"; //

No go. I made it this:

$host = "localhost"; //
$user= "thisismyusername"; //
$password= "thisismypassword"; //
$database="proguide_gallery"; //
// Connecting, selecting database
$link = mysql_connect ("$host", "$user", "$password") or die ("I cannot connect to the database.");

Still no go. ; (
Posted By: steelhead Re: Beta-[6.3-6.4] My Photos 1.0 - 02/05/2004 3:46 AM
any ideaa??
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 02/05/2004 7:10 AM
Steelhead,

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

mysql_select_db ("proguide_gallery")or die("Could not select database");
$query = "SELECT id,cat,title,bigimage,medsize FROM {$pp_prefix}photos WHERE userid = {$user['U_Number']} ORDER BY date DESC LIMIT $page,16";
$result = mysql_query($query);
$sth = $dbh -> do_query($query);
$numrows = $dbh -> total_rows($sth);
Posted By: JerseyDevil Re: Beta-[6.3-6.4] My Photos 1.0 - 02/11/2004 9:14 AM
Hi,

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?



Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 02/11/2004 4:20 PM
Jersey,

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

$imgurl = "[img]{$data_dir}/$ppcat/{$user['U_Number']}{$photo_name}-med{$theext}[/img]";

The above is the default photopost format

data/whichcat/usernumberphotonameextention
Posted By: JerseyDevil Re: Beta-[6.3-6.4] My Photos 1.0 - 02/11/2004 7:57 PM
[]Omegatron said:
Jersey,

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

$imgurl = "[img]{$data_dir}/$ppcat/{$user['U_Number']}{$photo_name}-med{$theext}[/img]";

The above is the default photopost format

data/whichcat/usernumberphotonameextention [/]

Ok, I'll try to get you to understand.. :-)

first just as a note you have a conflict in your directions. In the directions it says no slash and in the comments on the php after the path it says to put a slash (or vice-versa) can't remember without looking. It was the same on this sites download and also the other you posted it on.

OK, to the meat of the problem:

My path "www.The-Jersey-Devil.com/photopost/data" is were the bb users photos are (in the "500" sub folder) and folder "501" is where another catagories photo's are (I had to remove the 501 catagory for it to work).

Both the 500 folder and the 501 folder are created by photopost when the catagory is created. I tried www.The-Jersey-Devil.com/photopost/data/500 and I get "blank pics" in the select image screen when trying to add a pic to the post. If you look at the path of the "blank" thumb pics it shows the path is pointing at the 501 folder ??. So I tried "www.The-Jersey-Devil.com/photopost/data/500/" and still no go.

Anyway I need several differant catagories and the only way it wil work is with JUST the 500 folder inside the data folder. If you put the 501 back it trys to pull the images from there.

The only way I got it to work was with the path:
"www.The-Jersey-Devil.com/photopost/data" and only leaving the "500" sub folder in there if the 501 was ther no go.

If I extend the path to:
"www.The-Jersey-Devil.com/photopost/data/500" it won't work.


If the 501 folder is in there with this path:
"www.The-Jersey-Devil.com/photopost/data" it won't work.

Hope that explains it



Thanks
Posted By: Pappy Re: Beta-[6.3-6.4] My Photos 1.0 - 02/11/2004 8:38 PM
I had a similar issue the problem was solved by selecting a chmod value of 2777 so that files would inherit the group and not apache since I use SU-EXEC on that virtual Server. what would happen is the folder would get made but no files would move into it. one problem I did notice is that it appears that you may need to fix the permissions every time you create a new category (for the category folder) so that the files inherit properly. This is most likely because of the way I have my server set up but since I am admin and can get to the directories and modify them easily and it is not a big issue for me.
Posted By: JerseyDevil Re: Beta-[6.3-6.4] My Photos 1.0 - 02/11/2004 8:48 PM
[]Pappy said:
I had a similar issue the problem was solved by selecting a chmod value of 2777 so that files would inherit the group and not apache since I use SU-EXEC on that virtual Server. what would happen is the folder would get made but no files would move into it. one problem I did notice is that it appears that you may need to fix the permissions every time you create a new category (for the category folder) so that the files inherit properly. This is most likely because of the way I have my server set up but since I am admin and can get to the directories and modify them easily and it is not a big issue for me. [/]

I'm running Win 2003 Server, does this still apply ? Keep in mind the folders work properly and the catagories work well, the files move into them fine. Just the hack doen't when ther is another folder in the data folder.

Thanks
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 02/11/2004 9:32 PM
Jersey,

This hack does not care about what cat they are in.

you need to set your data_dir to this

$data_dir = "http://www.the-jersey-devil.com/photopost/data";


It pulls the photos based on userid. The cat variable is inherited from the query

$query = "SELECT id,cat,title,bigimage,medsize FROM {$pp_prefix}photos WHERE userid = {$user['U_Number']} ORDER BY date DESC LIMIT $page,16";

Sounds to me like you have some server issues.

If you look at how the image is displayed you will see what I mean.

It takes your data path and appends the cat number on it and then appends the userid and file name

That is how photopost stores information.
Posted By: JerseyDevil Re: Beta-[6.3-6.4] My Photos 1.0 - 02/11/2004 9:43 PM
[]Omegatron said:
Jersey,

This hack does not care about what cat they are in.

you need to set your data_dir to this

$data_dir = "http://www.the-jersey-devil.com/photopost/data";


It pulls the photos based on userid. The cat variable is inherited from the query

$query = "SELECT id,cat,title,bigimage,medsize FROM {$pp_prefix}photos WHERE userid = {$user['U_Number']} ORDER BY date DESC LIMIT $page,16";

Sounds to me like you have some server issues.

If you look at how the image is displayed you will see what I mean.

It takes your data path and appends the cat number on it and then appends the userid and file name

That is how photopost stores information. [/]

I was just going to post this reply, it seems that if the catagory is created after the hack it works... OR it just decided to start working on it's own.. I did reboot and it is windows

Either way Thank you very much...
Posted By: JerseyDevil Re: Beta-[6.3-6.4] My Photos 1.0 - 02/11/2004 10:03 PM
This is a wonderfull mod and the help in getting it working was second to none...
Posted By: JerseyDevil Re: Beta-[6.3-6.4] My Photos 1.0 - 02/16/2004 7:41 PM
NEXT page won't work. I've sat starring at this for hours. I can't figure out why "Next Page" won't work, can someone help please.

here it is..

<?
// Popup Graemlin Panel
//
// Copyright David Lozier 2003. All Rights reserved.
//
// This software may be used and modified freely provided that
// the copyright notice remains intact at the head of the file.
//
// This software may NOT be distributed without expressed written
// consent from the author.
//
// The author accepts no liability for any loss or damages whatsoever
// incurred directly or indirectly from the use of this software.
// The author of this software makes no claims as to its fitness for
// any purpose whatsoever. If you wish to use this software you
// should first satisfy yourself that it meets your requirements.
//
// Email: [][email protected][/]
// URL: http://www.chattersonline.com

// configure your database settings
$host = "localhost"; // Server Name
$user= "edited-out"; // Username
$password= "edited-out"; // Password
$database="the_jersey_devil"; // Photopost database name or forum database name

// Connecting, selecting database
$link = mysql_connect ("$host", "$user", "$password") or die ("I cannot connect to the database.");

require ("main.inc.php");

$pp_prefix="photopost_";
$data_dir ="http://www.the-jersey-devil.com/photopost/data"; //URL of your photo dir where those jpeg stored (with no / at end)

function get_ext( $filename ) {
return substr($filename, strrpos($filename,"."));
}

function is_image( $filename ) {
$retval = 0;

$mediatypes = array( ".jpg", ".gif", ".png" );
$ext = get_ext( $filename );

if ( in_array(strtolower($ext), $mediatypes) )
$retval = 1;

return( $retval );
}

$userob = new user;
$user = $userob -> authenticate();

$StyleSheet= $user['U_StyleSheet'];
$Status = $user['U_Status'];
$ubbt_language = ${$config['cookieprefix']."w3t_language"};

if (empty($ubbt_language)) { $ubbt_language = $config['language']; }

require ("$thispath/languages/$ubbt_language/instant_markup.php");

if (empty($StyleSheet) || ($StyleSheet == "usedefault") ) {
$StyleSheet = $theme['stylesheet'];
}

$theme['css_wrapper'] = $StyleSheet;
$myLang = "<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />";
$styleLink = "<link rel="stylesheet" href="{$config['styledir']}/$StyleSheet.css" type="text/css" />";

$html = new html;
list($tbopen,$tbclose) = $html -> table_wrapper();

if ( !isset($page) || $page == 0 ) {
$page = 0;
$nextpage = 1;
$prevpage = -1;
}
else {
$nextpage = $page + 1;
if ( $page > 1 ) $prevpage = $page - 1;
else $prevpage = 0;

$page = ($page*16);
}

mysql_select_db ("the_jersey_devil")or die("Could not select database"); //name of the photopostdb here

$query = "SELECT id,cat,title,bigimage,medsize FROM {$pp_prefix}photos WHERE userid = {$user['U_Number']} ORDER BY date DESC LIMIT $page,16";
$result = mysql_query($query);
$sth = $dbh -> do_query($query);
$numrows = $dbh -> total_rows($sth);

if ( $numrows < 16 ) $nextpage = 0;

$i=0;
$color = "lighttable";
$photorow="";
$photopanel="";

mysql_select_db ("the_jersey_devil")or die("Could not select database"); //name of the ubbthreadsdb here

while (list($ppid, $ppcat, $pptitle, $photo, $medsize) = $dbh -> fetch_array($sth)) {
if ( is_image($photo) ) {
$photolen = strlen($photo);
$theext = get_ext($photo);
$photo_name = str_replace( $theext, "", $photo );

if ( $medsize > 0 ) $imgurl = "[img]{$data_dir}/$ppcat/{$user['U_Number']}{$photo_name}-med{$theext}[/img]";
else $imgurl = "&#091;img&#093;{$data_dir}/$ppcat/{$user['U_Number']}$photo&#091;/img&#093;";

$mthumb = "<img border="0" src="{$data_dir}/{$ppcat}/{$user['U_Number']}{$photo_name}-thumb{$theext}" alt="" />";

$photorow .= <<<EOF
<td width="25%" align="center" valign="middle" class="$color">
<a href="javascript:void(0)" onclick="updatePost(' $imgurl')">$mthumb</a>
</td>
EOF;

$i++;
if ($i==4) {
$i=0;
$photopanel .= "<tr>$photorow</tr>";
$photorow = "";
$color = $html -> switch_colors($color);
}
}
}
if (!empty($photorow)) {
$photopanel .= "<tr>$photorow";
}

if ($numrows == 0 && $page == 0) {
$photopanel .= <<<EOF
<td colspan="4" align="center" valign="middle" class="$color">You have no images in your PhotoPost gallery.</td>
</tr>
EOF;
}
elseif ($i==1) {
$photopanel .= <<<EOF
<td width="25%" align="center" valign="middle" class="$color">
</td>
<td width="25%" align="center" valign="middle" class="$color">
</td>
<td width="25%" align="center" valign="middle" class="$color">
</td>
</tr>
EOF;
}
elseif ($i==2) {
$photopanel .= <<<EOF
<td width="25%" align="center" valign="middle" class="$color">
</td>
<td width="25%" align="center" valign="middle" class="$color">
</td>
</tr>
EOF;
}
elseif ($i==3) {
$photopanel .= <<<EOF
<td width="25%" align="center" valign="middle" class="$color">
</td>
</tr>
EOF;
}

echo <<<UBBTPRINT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>PhotoPost Panel</title>
$myLang
$styleLink
<script language="JavaScript" type="text/JavaScript">
function updatePost(GraemlinCode) {
BodyVal = opener.document.replier.Body.value;
opener.document.replier.Body.value = BodyVal + GraemlinCode;
}
</script>
</head>
<body>
$tbopen
<tr>
<td align="left" colspan="4" class="tdheader">
Instant PhotoPost
</td>
</tr>
$photopanel
</tr>
<tr>
<td colspan="2" class="lighttable">
UBBTPRINT;

if ( $prevpage != -1 ) echo "<< <a href="pppanel.php?page=$prevpage">PREV PAGE</a>";

echo <<<UBBTPRINT
</td>
<td colspan="2" class="lighttable" align="right">
UBBTPRINT;

if ( $nextpage > 0 ) echo "<a href="pppanel.php?page=$nextpage">NEXT PAGE</a> >>";

echo <<<UBBTPRINT
</td>
</tr>
<tr>
<td colspan="4" class="lighttable" align="center">
<a href="#" onclick="javascript:window.close();">close window</a>
</td>
</tr>
$tbclose
</body>
</html>
UBBTPRINT;


?>
Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 02/16/2004 11:07 PM
Jersey the next page function works just fine. You can PM me a user that has more than 16 photos to check out but I assume you probally have a browser or java problem which causes the page not to refresh.
Posted By: JerseyDevil Re: Beta-[6.3-6.4] My Photos 1.0 - 02/16/2004 11:18 PM
Thanks Chuck, I sent you them..
Posted By: JerseyDevil Re: Beta-[6.3-6.4] My Photos 1.0 - 02/17/2004 12:14 AM
Just wanting to keep this in thread.. Still can't get the next page thing working, chuck looked at it also.

Thanks Chuck I do appreciate the effort. I'll keep staring at it and maybe it will make sense why it won't work, I know you said you had it working elswhere so it's possible. Now I just have to find a good book on php I am a total newbee to php @ sql but the longer I stare at the stuff the more sense it starts to make.

Being I'm new to this and all I'm not sure but I would think any hacks that are used credit should be given to there respective authors somewhere on the bb, is this so and where do they usually get put?

Scott
Posted By: JerseyDevil Re: Beta-[6.3-6.4] My Photos 1.0 - 02/17/2004 12:25 AM
Just to clarify the problem:
When you click "next page" the page "refreshes" but the same pictures are displayed. They do not change to the next 16 pictures in the album. So it seems to be a query thingy (yea i'm an newbee)...
Posted By: Astaran Re: Beta-[6.3-6.4] My Photos 1.0 - 02/17/2004 2:49 PM
My tipp is that it's a problem with global variables.
I assume you've turned register globals off, what is the default value in newer php-versions.

Try to add this to the top of the ppanel.php:

$page = get_input("page","get");
Posted By: JerseyDevil Re: Beta-[6.3-6.4] My Photos 1.0 - 02/17/2004 5:18 PM
THANK YOU !.... so much, IT WORKS ! I was up for hours for the last few days. I will post the final working copy as it is on my Windows 2003 server... YEA... I love this hack. It makes the bb so much better.

I appreciate everyones time. Hopefully I can contribute over in the futre..
Posted By: JerseyDevil Re: Beta-[6.3-6.4] My Photos 1.0 - 02/17/2004 5:49 PM
Just a quick question, am I correct in assuming this line

$ubbt_language = ${$config['cookieprefix']."w3t_language"};

should be changed to the actual database prefix i'm using as in:

$ubbt_language = ${$config['cookieprefix']."photopost_language"};

(seems to work either way ?)

If i'm WAY off base take it easy on me..

Posted By: omegatron Re: Beta-[6.3-6.4] My Photos 1.0 - 02/17/2004 5:56 PM
$ubbt_language = ${$config['cookieprefix']."w3t_language"};

is the correct use.
Posted By: JerseyDevil Re: Beta-[6.3-6.4] My Photos 1.0 - 02/17/2004 6:26 PM
Thanks Chuck..
Posted By: JerseyDevil Re: Beta-[6.3-6.4] My Photos 1.0 - 02/17/2004 7:08 PM
Here's the pppanel.php as I have it working on a Windows server 2003 and the most current version of threads and photopost.

Hope this helps someone in the future.

see attachment. You must rename it from .txt to .php

Scott

Attached File
108127-2-17-2004-pppanel.txt  (56 downloads)
Posted By: Gary_dup1 Re: Beta-[6.3-6.4] My Photos 1.0 - 06/29/2004 3:09 PM
This is the best damn mod I've ever seen... oh yes...
Posted By: AllenAyres Re: Beta-[6.3-6.4] My Photos 1.0 - 06/30/2004 12:13 AM
hehe
Posted By: DrChaos Re: Beta-[6.3-6.4] My Photos 1.0 - 07/01/2004 4:49 PM
/*captain kirk

I.... need... photopost
got.....to...get.....photopost

captain kirk*/
Posted By: Gary_dup1 Re: Beta-[6.3-6.4] My Photos 1.0 - 07/01/2004 5:00 PM
Yeah... you do... really! It's a total bitch to skin (although nowhere NEAR as difficult as UBBT!) and unless your server is the zenith of recent technological marvels, it's gonna be a bitch to install, and a TOTAL drain on your CPU resources... but it is damn pretty, and my GOD will your visitors love it!
Posted By: DrChaos Re: Beta-[6.3-6.4] My Photos 1.0 - 07/01/2004 5:09 PM
[] but it is damn pretty, and my GOD will your visitors love it!
[/]

LMAO!
Posted By: Zarzal Re: Beta-[6.3-6.4] My Photos 1.0 - 09/24/2004 4:00 PM
is there a Threads V6.5 version of this hack avaible ?

/edit: I bring it to work. Follow the instructions for pppanel.php but change the include path zo ./includes/ubbt.inc.php

edit ubbt_instant_ubbcode.tmpl as decribed

Then do not edit showflat and showthread but do edit on quickreply.tmpl like this:

##search for:
function openGraemlinPanel() {
graemlinWindow=window.open('{$config['phpurl']}/graemlinpanel.php','graemlinpanel','scrollbars=yes,resizable=yes,width=800,height=400');
if (graemlinWindow.opener == null) graemlinWindow.opener = self;
}

## insert under:
function openPhotoPanel() {
photoWindow=window.open('{$config['phpurl']}/pppanel.php','pppanel','scrollbars=yes,resizable=yes,width=465,height=500');
if (photoWindow.opener == null) photoWindow.opener = self;
}

## search for:
<a href="javascript:void(0)" onclick="openGraemlinPanel()"><table class = "darktable"><tr><td class = "buttons">{$ubbt_lang['MORE_G']}</td></tr></table></a>

## insert under:
<a href="javascript:void(0)" onclick="openPhotoPanel()"><table class = "darktable"><tr><td class = "buttons">Use My Photos</td></tr></table></a>

save, finish. it work.
Posted By: ksanuk Re: Beta-[6.3-6.4] My Photos 1.0 - 12/24/2004 6:39 AM
Hi,

Okay, read through the entire thread making changes to the code all the way through, but it still isn't working.

I get the following error messages:
Code
<br />SQL ERROR: Database error only visible to forum administrators<br /><br />Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /export/data1/vhosts/board64.nanaplaza.com/httpdocs/mysql.inc.php on line 160<br /><br />Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /export/data1/vhosts/board64.nanaplaza.com/httpdocs/mysql.inc.php on line 133<br />


The SQL call is :
Code
<br />SELECT id,cat,title,bigimage,medsize FROM photos WHERE userid = 6 ORDER BY date DESC LIMIT 0,16<br />


which seems correct. Had to make some changes to this as well as userid was not '6' but 'p' using the original code.

Sanuk!

PS Still on 6.4b1
Posted By: ksanuk Re: Beta-[6.3-6.4] My Photos 1.0 - 12/31/2004 4:09 AM
Hi,

Just spend another hour or so on this, but cannot get it to work

My code looks like this:
Code
<br />// configure your database settings<br />$host = "localhost"; // Server Name<br />$user= "***"; // Username<br />$password= "***"; // Password<br />$database="***"; // 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 $database");<br /><br />$query = "SELECT id,cat,title,bigimage,medsize FROM {$pp_prefix}photos WHERE userid = {$UBBTuser} 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 />$host = "localhost"; // Server Name<br />$user= "***"; // Username<br />$password= "***"; // Password<br />$database= "***"; // Threads database name or forum database name<br /><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 $database");<br /><br />if ( $numrows < 16 ) $nextpage = 0;<br />


As far as I can tell all the info is correct. Added an 'or die' after '$result = mysql_query($query);' and that statement seemed to execute fine, which to me seems to indicate that the SQL statement is okay.

Anybody any solutions or suggestions?

Sanuk!
Posted By: Zarzal Re: Beta-[6.3-6.4] My Photos 1.0 - 03/10/2005 4:56 PM
Hi Omegatron,

with the release of PP5 comes a lot of changes and it seems that this little mod needs an update. I read this in the PP5 announce:

If you are running any scripts that pull information from the PhotoPost database, that script probably uses the -thumb and {userid}{filename}.jpg convention - those scripts would have to be modified to just use the {bigimage} filename and not use the userid at all.
Posted By: donJulio Re: Beta-[6.3-6.4] My Photos 1.0 - 03/16/2005 5:58 AM
This mod definitely does need updating, by anyone. Adding it to the forum is almost the same as in the instructions, with the only difference in adding it to the quickreply.tmpl file now. Now the problem is the pppanel.php script itself, for us PhotoPost 5.0 users. I myself just noticed that it is now broken
Posted By: Gary_dup1 Re: Beta-[6.3-6.4] My Photos 1.0 - 04/28/2005 5:32 PM
I've just changed server, and now my threads and pp databases use different authentication information...

I've looked all through this thread, and EVERYONE seems to be using the same username and password details... can someone give me the syntax if I want to use different details for each database?

Cheers.
© UBB.Developers