UBB.Dev
Mod Name / Version: UBBThreads Photopost Total Integration Version 4.8.2

Description: This modification will allow UbbThreads 6.5b6 and Photopost 4.8.2 to integrate seamlessly.

Working Under: UBB.Threads 6.5

Mod Status: Beta

Any pre-requisites: Must own both UBBThreads and Photopost

Author(s): TrAvELAr

Date: 09/03/04

Credits: Omegatron for his continued efforts to keep this mod up to date

Files Altered:
Photopost------pp-inc.php

Threads--------header-insert.php, online.php

New Files: None

Database Altered: None

Info/Instructions: Back up your files before modifying!!!

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
119462-photpost482.txt  (354 downloads)
Tried this and here's what I'm getting...

Code
 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ../forums/threads.php on line 31<br /><br />Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in ../photo/forums/threads.php on line 285<br /><br />Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in ../forums/threads.php on line 58 


I removed my URL from the above code and replaced with '..'

It's also not recognizing any users from my threads database (at least this is how it's appearing to me). Plus I'm not too sure if I was suppose to put the photopost folder within the threads folder or if it didn't matter. As you can tell by my many posts here on ThreadsDev, I'm a newbie but always anxious to try this stuff out.

Any suggestions?
Can anyone confirm if this mod is working - I have not got a copy of 6.5 up at the moment so can't verify.
[]Ian_W said:
Can anyone confirm if this mod is working - I have not got a copy of 6.5 up at the moment so can't verify. [/]

It's working on a clean install on my system. But a second confirmation would be good since my PHP skills are very limited.
Well there is no need for this mod with Photopost 4.8.2

My advice to anyone attempting this mod is simply don't. I am not trying to be mean but Photopost 4.8.2 by default has build in UBBThreads stylesheet integration.
Chuck - I thought that by default Photopost will not display items such as the IIP sidebar etc., and as it's own sidebar built in.

Although I haven't tried it, I am guessing this mod allows for items such as the IIP sidebar to display.
PhotoPost only grabs the stylesheet, but not the Threads headers or footers. So you do need this if you're at all interested in having the IIP Sidebar included and/or the ubbt_(un)registerednav.tmpl and ubbt_footer.tmpl templates called.
You would be correct in assuming that.

However note designing a header and making the navbars display are relatively simple things. The purpose of this integration in the past was to pull the header so we could use the Threads stylesheet. Photopost by default pulls the stylesheet and a user can display a a header by simple html with php switchs for links that require whether a user is logged in or out for it not to display. I have posted quite a few times a sample header in the old Integration thread how to do this with 4.8.2. These are all normal functions one can do with Photopost without any hacking.

If one wants the IIP sidebar to display or not thats a simple hack as well and it would be advisable to write a hack simply for that. That way there is no need for further code alteration to do things Photopost by default does. I may do that for those interested in pulling the IIP sidebar.

I was never asked permission if someone could alter and repost my work. That by default is the status quo in any hacking community. Besides the only two users posting in this thread have stated the hack posted here does not work, hense my warning to others not use this hack. It does not seem to work for anyone and posted without permission.

Posted here is a sample header you can use as a guideline to see how to pull the same header as Threads over Photopost.

<?

echo <<<PPPRINT

<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="tlc">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
<td align="left" class="topleft">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="70" height="10" alt="" /></td>
<td width="100%" class="top">
</td>
<td align="right" class="topright">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
<td class="trc">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td class="left">

<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
<td width="100%" colspan="3">
<table width="100%" align="center" cellpadding="0" cellspacing="0" class="tablesurround">
<tr>
<td>
<table cellpadding="2" cellspacing="1" width="100%" class="tableborders">
<tr class="tdheader">
<td colspan="3" align="center">Welcome to ReefTalk</td>
</tr>
<tr>
<td class="logo">
</td>
</tr>

</table>
</td>

</tr>
</table>
</td>
<td class="right">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td class="blc">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
<td align="left" class="botleft">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
<td width="100%" class="bottom">
</td>
<td align="right" class="botright">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
<td class="brc">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>

</tr>
</table>

<br />

<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="tlc">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
<td align="left" class="topleft">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="70" height="10" alt="" /></td>
<td width="100%" class="top">
</td>
<td align="right" class="topright">

<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
<td class="trc">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td class="left">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
<td width="100%" colspan="3">
<table width="100%" align="center" cellpadding="0" cellspacing="0" class="tablesurround">
<tr>
<td>
<table cellpadding="2" cellspacing="1" width="100%" class="tableborders">
<tr>
PPPRINT;
if ( $User['userid'] > 0 ) {
echo <<<PPPRINT
<td align="left" valign="bottom" width="25%" class="menubar">
Welcome {$User['username']}.
[<a href = "{$Globals['vbulletin']}/logout.php">Logout</a>]
<br />
<a href = "{$Globals['vbulletin']}/login.php">My Home</a>
·
<a href = "{$Globals['vbulletin']}/contact/mycontacts.php" $target>My Contacts</a>
PPPRINT;
}
echo <<<PPPRINT
<td align="left" valign="bottom" width="75%" class="menubar">
PPPRINT;
if ( $User['adminedit'] == 1 ) {
echo <<<PPPRINT
<a href = "{$Globals['vbulletin']}/admin/index.php">Admin</a>
·
PPPRINT;
}
echo <<<PPPRINT
<a href="{$Globals['vbulletin']}/ubbthreads.php/Cat/">Main Index</a>
·
<a href =" http://www.reeftalk.com/index.php/Cat/" target="_top">Entrance</a>
·

PPPRINT;
if ( $User['userid'] > 0 ) {
echo <<<PPPRINT
<a href = "{$Globals['vbulletin']}/mypaymentpal/mypaymentpal.php" $target>Subscription Area</a>
·
PPPRINT;
}
if ( $User['userid'] > 0 ) {
echo <<<PPPRINT
<a href = "{$Globals['vbulletin']}/showmembers.php?Cat=0&page=1" $target>User List</a>
·
PPPRINT;
}
echo <<<PPPRINT
<a href =" {$Globals['vbulletin']}/search.php?Cat=" target="_top">Search</a>
·
<a href =" {$Globals['vbulletin']}/online.php?Cat=" target="_top">Who's Online</a>
·
<a href =" {$Globals['vbulletin']}/faq.php?Cat=" target="_top">FAQ</a>

·
<a href =" http://www.reeftalk.com/bio.php">Staff Bio's</a>
·
<a href =" http://www.reeftalk.com/sponsor.php">Sponsor's</a>
·
<a href =" http://www.reeftalk.com/gallery/index.php">Photo Gallery</a>
·
<a href =" http://www.reeftalk.com/reviews/index.php">Reviews</a>
·

<a href =" {$Globals['vbulletin']}/chat/chat.php">Chat Room</a>
·
<a href =" {$Globals['vbulletin']}/links.php">Site Links</a>
·
<a href =" http://www.reeftalk.com/shop.php">Reeftalk Store</a>
·
<a href =" {$Globals['vbulletin']}/calendar.php?Cat=" target="_top">Calendar</a> · <a href = "{$Globals['vbulletin']}/contactus.php">Contact Us</a>
</td>
</tr>

<tr>
<td colspan="2" align="center" class="darktable">
<a href='http://www.reeftalk.com/plugins/phpAdsNew/adclick.php?n=a95d6f32' target='_blank'><img src='http://www.reeftalk.com/plugins/phpAdsNew/adview.php?what=zone:1&n=a95d6f32' border='0' alt='' /></a>
</td>
</tr>
<tr class="tdheader">

<td colspan="2" align="center">Support our Sponsor's</td>
</tr>

</table>
</td>
</tr>
</table>
</td>
<td class="right">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td class="blc">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
<td align="left" class="botleft">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>

<td width="100%" class="bottom">
</td>
<td align="right" class="botright">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
<td class="brc">
<img border="0" src="{$Globals['vbulletin']}/stylesheets/images/spacer.gif" width="10" height="10" alt="" /></td>
</tr>
</table>

<br />

PPPRINT;

?>

Note this is for information only and would need to alter but would see how you need to surround links that only display for logged in user's or admin etc.
I for one don't know if this mod works either, because I am still on PhotoPost 4.8.1. Since PhotoPost does now pull the threads stylesheet by default and you can set the path to the generic header and footer that threads uses in the PP admin area, you can get almost the exact loog, sans nav bars. Omegatron is right about how easy it probably is to include the nav bars anyways, so the only real hacking would be to make the IIP Sidebar work with PhotoPost.

I for one am going to have JC redo my site and add a left-hand menu bar for such things as forums, galleries, etc. so I won't need the nav bars either. In that case what they have done with PhotoPost will suit my needs just fine
personally I still remove the photopost header function and use a modified one based on threads.. but I respect Omegotron's position on this and won't post it.. it does allow for sidebar and header from IIP 6.5 and threads 6.5 and photopost 4.8.2 thats all I will say on the matter.
Scroungr

Thanks. I have no problem reposting my original hack updated for 4.8.2 if enough people really want it. I mean it would take me like 10 minutes to go through and update it.

What really burns my britches is seeing someone just steal it without asking and posting it here and it clearly is not working as well.

Like I stated it might be easier just to include the sidebar instead of altering code that already works by default to pull the styles etc.
Posted By: smoknz28 GD2 Directory - 10/16/2004 11:09 AM
I left a PM for Chuck on this one...but hopefully someone can get back to me sooner on this one...

I'm having an issue with ImageMagick...so I believe as we can see the smaller photos...but when it comes to the medium or large sized photos...no go.

So, I am going to switch back to GD2....can someone please let me know what the default directory should be to GD2...?

Thank you,
Mark
Posted By: scroungr Re: GD2 Directory - 10/16/2004 8:34 PM
Hmm you sure? cause the larger photos are what you upload and the smaller is what gets thumbnailed by ImageMagick.. sounds like your larger are getting deleted..
Posted By: smoknz28 Re: GD2 Directory - 10/18/2004 12:54 PM
[]scroungr said:
Hmm you sure? cause the larger photos are what you upload and the smaller is what gets thumbnailed by ImageMagick.. sounds like your larger are getting deleted.. [/]

Yea, very strange....I've not touched the configuration of the PhotoPost program in quite some time. So I truely don't have an idea of what is causing this. Just thought I'd attempt to go back to what I know had worked for me for a while previously while using GD2.
Omegatron, I have a question to your example (or more then one):

1) do you include the header as .php or .htm ?

2)
PPPRINT;
echo <<<PPPRINT
this surround any php function in the header?

3) what should I do with $tbopen and $tbclose?

Now I try for several days but I dont bring it to work with ubbt. I get the ubbregistrednav.tmpl and try to convert it for PP. Everytime I only get a screen with my background image. I do something wrong, but dont know what.
I replied to your PM it sounds to me like your using on the fly watermarks with imagemagick which is a no no

zarzaL

1) do you include the header as .php or .htm ?

PHP

2)
PPPRINT;
echo <<<PPPRINT
this surround any php function in the header?

YES

3) what should I do with $tbopen and $tbclose?

THEY BECOME $ppopen and $ppclose or you just place the html equivelent in there

I posted a mock header in my old thread on the integration that I use.

As far as php switch's to see if a user is an admin or to show which buttons whether logged in or out I use the Photopost equivelent things like this

if ( $User['adminedit'] == 1 ) {

blah blah

}


if ( $User['userid'] > 0 ) {

blah blah

}
Ok this mod does work. I am finding the issues to be that the user is not reading the instructions correctly and not setting the user database to threads and thus is not pulling from the threads user table. there are specific settings to make it work with each forums scripts. In general in the config-inc.php

make sure

// Path to your PhotoPost installation - no end slashes
$PP_PATH = "";

// PhotoPost database host address, or leave as localhost
$host="localhost";
$database="yourphotopostdatabase";
$mysql_user="yourphotopostdbuser";
$mysql_password="yourphotopostdbpassword";
$pp_db_prefix = "yourphotopostdbprefix(pp_,w3t_,etc";

// User database host address, or leave as localhost
$host_bb="localhost";
$database_bb="yourthreadsdatabase";
$user_bb="yourthreadsdbuser";
$password_bb="yourthreadsdbpassword";


and in your photopost control panel under edit options make sure User Registration System is set to threads
also all the above code really does is allow for using the threads header and threads menu which PP does not as a standalone. if they would get pp to be able to use the threads menu this mod would not be neccessary since now with version 4.8.2 you have sidebars and can pull the threads stylesheet...
What does this error mean?

Warning: ob_start(): output handler 'ob_gzhandler' cannot be used twice in /usr/www/efs/forums/photopost/pp-inc.php on line 153
<
anyone?
ob_start() is being called twice. take alook at the code again.
I am not sure what I am looking for but I checked to make sure I followed the instructions
Code
// If they want compression, enable it!<br />if ( $compression == "1" && !isset($disableforadmin) ) {<br />    $phpa = phpversion();<br />    $phpv = $phpa[0] . "." . $phpa[2] . $phpa[4];<br />    if (($phpv > 4.0004) && extension_loaded("zlib") && !ini_get("zlib.output_compression") && !ini_get("output_handler")) {<br />        ob_start("ob_gzhandler");<br />    }<br />}<br />


that is the only instance of ob_start in pp-inc.php
ubbt.inc.php already uses it, which is probably conflicting with this script if both are enabled.

Try commenting out that code block in pp-inc.php to see what happens ie. if compression is still functional.
Commenting it suppressed the error with no adverse effects . How would I know if compression was still functioning?
Is main.inc.php one of the includes in the Photopost page that you are refreshing? If so (and I would assume it is since it's all integrated), and if compression is enabled for the forums (in the admin panel), then it would have to be enabled for that script too.
Ok I just checked, and it does call main.inc.php just like I suspected...

###
### In pp-inc.php find this:

Find:

require "{$Globals['PP_PATH']}/languages/$pplang/pp-inc.php";
require "{$Globals['PP_PATH']}/languages/$pplang/login-inc.php";

Insert Below and set path to main-inc.php:

/// Require the library. Edit the path to the
// main.inc.php file if necessary.
require ("/PATH/TO/main.inc.php");


So from what I can tell, that compression code isn't even necessary and shouldn't be there.
Yes that makes sense and being that this is inserted into pp-inc.php

/// Require the library. Edit the path to the
// main.inc.php file if necessary.
require ("/PATH/TO/main.inc.php");

that would mean it is functioning.

Thankyou for the lessons guys.
Hi,

Having some slight issues with PhotoPost 4.8.2 and UBBT 6.4.b1

Got PhotoPost to see and use the threads database, as well as the stylesheets. Even managed to include the header from UBBT, but I would like a bit more integration.

I would really like to be able to add some pics (maybe the random piccy) to the sidebar on UBBT.

I'm also experiencing problems with the logins. Logging in to UBBT does not always seem to log you in to PP. And when logging in to PP, I often get problems in UBBT (get told I am not logged in, yet the login screen display My Home). Only way to solve that is by logging out of PP and relogging in to UBBT.

So, any suggestions on how to include pics from PP in my UBBT sidebar?
And any ideas what might be wrong with the login?

Sanuk!
Hi,

A bit more info on the login problem.
I am currently logged in to my board, but when I go to PhotoPost I am not recognized as being logged in. Checked the cookie and it is the one for UBBT. Deleted that, went back to UBBT, logged in there again and came back to PP. Reloaded the home page, but I'm still considered to be not logged in.

Sanuk!
You can use this to place a pal on the ubbt sidebar

https://www.ubbdev.com/forum/showflat.php/Cat/0/Number/96544/an/0/page/0/gonew/1#UNREAD

As far as not being logged in I would look at your cookie settings. Threads does not allow configuration of a cookie domain so in essense it is blank meaning it will be whatever you run on like domain.com or www.domain.com

Threads would be like this

cookie domain blank
cookie path /
cookie prefix by default is w3t_

So Photopost would be

cookie domain blank
cookie path /
cookie prefix blank as w3t_ will be used if left blank.
Hi,

"You can use this to place a pal on the ubbt sidebar"

Thanks, will check it out.

"As far as not being logged in I would look at your cookie settings."

Yeah, that turned out to be the problem. One of my Mods send me screenshots of his cookies before and after going to the gallery. There were entries in with both w3t_ and w3t_w3t_. Figured it was a cookie problem, removed the w3t_ from the gallery configuration and things have been working fine since.

Sanuk!
What the heck does this mean... The wording here is not logical and very confusing.. Maybe a re-write? I have no idea what im suppose to copy and paste, and where im suppose to copy and past it to??

[] STYLESHEETS:

Now you will need to do one more step. You need to add the following classes to each and every stylesheet you use. There will be one more class to add as well.
Many people use images in their tdheader tag so the first class you need to create is the following. Copy and paste your tdheader class under the tdheader class.
Rename this second class to tdnothumbs. That way it will also be uniform if you use images in that tag. Then copy and paste all the rest here under that and set them
to the class color as instructed.
[/]
Again as I have pointed out since Traveler ripped of my original mod which was for Photopost 4.7 and below.

Photopost 4.8 and above have no need to rewrite the CSS classes. Simply in admin section of Photopost in admin options set

Use Integrated Forum Stylesheets to YES
© UBB.Developers