UBB.Dev
Hack

This hack places your PhotoPost forums on the index page of UBBThreads.

Additions for v2:

- XHTML compliant (Thanks Omegatron)
- Lightbulbs now work
- Cleaned up some html code
- Additional documentation

Example site: http://www.extremefitness.com

Left To Do:

- Optimize MySQL calls (doesnt cache data like threads does)
- Security not implemented (shows all groups)

Instructions:

In your ubbthreads.tmpl file in your templates/defaults directory, find around line 84:

echo <<<UBBTPRINT
<!-- END CATEGORY LOOP -->

AFTER that insert the contents of the attachment here.

Be sure to edit the paths and paramters for MySQL access to fit your site.

In my installation, I editted the pp-inc.php (topmenu function), showgallery.php and showphoto.php files to point HOME to the UBBThreads index.

Attached File
51892-photopost2.txt  (101 downloads)
looks good... does the search pages tie-in to each other?
I would suggest making the html part of the mod xhtml-compliant as well... a lot of work went into threads getting it there. I can assist if you like
Quick question, would having the pics displayed on the index page cause greater bandwidth?
My next "project" is to convert all the HTML over to templates; so will get your help when I do that. I didnt want to put in all the effort upfront since I knew I would be redoing all of that soon enough. But as soon as I get going on templates, you're the guy I am going to call.

And, no, there is no other integration at this point. I plan to make a "deep intergration" hack which will use UBBThreads Whose Online, Last Visit, Search and others areas. (Don't ask, I dont know when I will be able to do all that; but hopefully not too far off!)

If the thumbnails are served off your host, then you will incur the bandwidth of displaying those thumbnails.
Installed, but with partial success.

http://www.techimo.com/forum/showthread.php?s=&postid=285590#post285590
I saw that and replied over there, I would immagine that is the problem since it can't be remotely calling his script I'm going to install mine later today so I'll let everyone know how it goes.
Well, that link would only be displayed if it were displaying the categories in the first place. I guess the question is - why arent any of your categories showing up.
oops, didn't see you reply here, I sent you another PM.

The more I looked at the code I realized that stuff before that should be showing up to begin with... but I can't tell what would be throwing it off. Its not displaying any errors or anything, so I dunno. I'm not a coder unfortunately
Ok, done!! Thanks Michael. A couple of creases still, and I have posted in the PP forum, whenever you have time

Thanks again
Okay I have managed to make this hack XHTML Compliant. For those that want this the updated hack is attached.

Very simple to install. Just fill out your database info and paths to gallery etc. Place the code right above the send_footer line in ubbthreads.php

Totally XHTML Compliant.
I've made an update to use the light bulbs. I'll doc the changes tomorrow and post it. Here's my site with the hack in place:

http://www.extremefitness.com
I have posted the updated script in the first post of this thread. Enjoy!
Hi

Edit : I'v just had PhotoPost3.2 installed by them and threads is supposed to be integrated but there was no links between them.

I have made the link from II5.2 to PP. JUST A LINK

Q1. Does this hack put a link on the PPost index page so I can return to Threads/II5.2 ?

Q2. If so which attachment do I use as there is 2 on this thread ?

Edit: I've just re-read this thread and still don't know what it does?

Thanks
George,

This hack does not place a link back to UBBThreads. However that is very easy. In your photopost gallery find the file pp-inc.php. Look for the following code below:


if ( $rows > 0 )
$menu .= "<img border="0" src="{$Globals['idir']}/check.gif" alt="New Photos" /> ";

$menu .= "<a href="{$Globals['maindir']}/adm-index.php">{$Globals['pp_lang']['admin']}</a> | <a href="{$Globals['maindir']}/index.php">{$Globals['pp_lang']['home']}</a>";
}
else
$menu .= "<a href="{$Globals['maindir']}/index.php">{$Globals['pp_lang']['home']}</a>";


REPLACE IT WITH THE FOLLOWING FILLING OUT YOUR PATH TO THREADS:


if ( $rows > 0 )
$menu .= "<img border="0" src="{$Globals['idir']}/check.gif" alt="New Photos" /> ";

$menu .= "<a href="{$Globals['maindir']}/adm-index.php">{$Globals['pp_lang']['admin']}</a> | <a href="http://www.PATHTO/ubbthreads.php">{$Globals['pp_lang']['home']}</a>";
}
else
$menu .= "<a href="http://www.PATHTO/ubbthreads.php">{$Globals['pp_lang']['home']}</a>";


Hey!

I posted this on the PP site but thought I might have better luck here. I cannot get the 3rd level categories to show on the totals of the homepage.

I ahve attached a screenshot of what is showing for a single category.

Thanks for the help,

-Jason

Attached picture 64556-index.jpg
This is the corresponding pp index screenshot

Attached picture 64557-ppindex.jpg
Contents of my ubbtemplate-



Attached File
64558-ubbthreadstmpl.txt  (307 downloads)
When I add this as directed, I get this error:

[]
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in D:\wwwroot\fiebre.com\ubbthreads\templates\default\ubbthreads.tmpl on line 126
[/]
Hi Chuck

Just read your reply, been busy adding lots of hacks (some with your help - thanks).

Yes it works fine - just changed the address to index.php to point to II5.2

Thanks
Allen,

That's usually a misplaced bracket or something somewhere before that line.

Paste that section (a little before that line number here) and I'll look.
thank you... I added some print statements and it shows up, but needs some other html (perhaps an open and close table) for it to look right

http://www.fiebre.com/ubbthreads/ubbthreads.php
ok

this is what it needs:

==========================================================

FIND in ubbthreads.tmpl:
Code
<br />echo <<<UBBTPRINT<br /><!-- END CATEGORY LOOP --><br /><!-- END OF FORUM LOOP --><br /></table><br /></td><br /></tr><br /></table><br /><br /><br /><br />$tbopen<br />

REPLACE WITH:
Code
<br />echo <<<UBBTPRINT<br /><!-- END CATEGORY LOOP --><br /><br /><!-- END OF FORUM LOOP --><br /></table><br /></td><br /></tr><br /></table><br />UBBTPRINT;<br /><br />echo <<<UBBTPRINT<br /><br /><br />$tbopen<br />

=============================================

then place the code provided in the first post in this thread above :
Code
<br />echo <<<UBBTPRINT<br /><br /><br />$tbopen<br />


that will fix the layout probs
Actually if we look at the mistake made in the release version of the template I use this and it works

echo <<<UBBTPRINT
<!-- END CATEGORY LOOP -->
<!-- END OF FORUM LOOP -->
$tbclose
UBBTPRINT;
photopost code here!
echo <<<UBBTPRINT
<br />
$tbopen
good eye it does need a tbclose there instead of the html
I actually managed to integrate this hack into my site and it kinda works! No one is more surprised that I could do this than I am

The issues I'm having:

My biggest PP subcat shows on the UBBT page as having 0 posts and 0 uploads. Why won't the correct numbers show?

One of my top-level gallery categories isn't showing up -- I'm only seeing two of the three. It's the only category with no sub-categories, if that's related.

The "lightbulbs" don't change once gallery threads are viewed. If the category has photos in it, the lightbulb stays yellow.

How do I put a title above the displayed photos (something like, "Most recent additions to our gallery"?


I'm using the current release of Photopost, and UBBT 6.2.

Thanks!
Yeah, same problem I posted above, lower level cats arent totalling up for some reason.

-Jason
Me too!
I'm having same problem here....

I'm using Photopost 3.2 with Ubbtheads 6.2(last release)

Thanks
Junhyok
Guys Extremebikini has noted all problems with this hack and in his spare time has said over in the photopost forum that he is working on this when time permits.

I have updated it use the $tbopen and $tbclose variables for flexibility and those that use the table wrappers from here.

I will look into the categories and try a few things out myself although I have never used subcategories I shall see if I can get it to work.

I posted another update in my next post to correct most issues.
Sorry, guys; been real busy with some new products and havent had time to go back and work on this. I havent even been able to load 6.2 myself yet!

I was able to make light bulbs work on my current release - but I havent tried it with 6.2 yet. Unless someone gets to it before me it will be a week or two (at least).
No problem and thanks for the hard work!
Thanks a lot! guys...

Junhyok
Okay,

To summarize what has been done. The only issue I that has to be cleared up is the cookie issue which Michael is working on.

1) Totally XHTML Compliant
2) Updated to use $tbopen and $tbclose
3) Subcategories are now being included in the main count ( Keep in mind this hack does not display subcategories on the main threads page nor is it designed to. )

The only issue I see left is cookies. Follow the directions in the attachment.

ADDED 2-9-03:

Directions have been tweaked to take the user information out of template and put into PHP file for security issue.

Attached File
65702-photopost.zip  (28 downloads)
Hate to be the doorknob, but I cant remember what cookie problem.
For the cookies to work and update

Right now the lightbulbs stay on all the time.

You had meantioned you might have had a bit of code also in ubbthreads.php so that it would recognize and update the lightbulbs. Just like you had that query routine that got the counts for the thread totals and such.
Oh, right; I have the code for that. Its not a cookie thing, its just the code I had to add. I'll email you my new ubbthreads file so you can see if and yank it out.
Thanks thats the one thing left. I guess I should have said light bulb problem. God knows I hate seeing those yellow light bulbs all the time.
ennyone tried this recently? I kept getting table problems around the photopost stuff, like something was missing... anyways I used the code from the first post and the touchups from the second page and it looks ok.
I use the last version I posted and it validates and looks okay. I am still waiting on Michael to send what code he has inserted into ubbthreads.php to make the lightbulbs work.

The original one posted here is not XHTML compliant and uses the old table structure.
I'll send it in the morning; just about got 3.3 done and finished ReviewPost this week, too!..... phew*
Oh my your making my day. A new version of Photopost to play with soon and finally Reviewpost HMM I am gonna be busy.

I assume your sticking with 3.3 being the CSS version with templates coming later in like 3.4? At least thats what I remember on our last conversation.
I'm having one problem with this integration.

I only employed part of the hack. On my Threads board, I have a row of photos that says, "The latest photos added to our Photo Gallery". There, I call the 5 latest pics that have been uploaded, and the hack works fine.

I'd like to restrict these pics to the 5 latest photos uploaded from one specific gallery. However, when I try to edit the hack to list the gallery id (in my case, 503), I end up getting an error (the page stops loading after the "5 latest pics" title). I assume the line of code where I'm having problems is the one that reads:

$forcats = "";

I can't figure out what I'm doing wrong. I just insert the category number inside the quotes, right?
Coy,

You can thank JoshPet for this fix. The code was missing a farther defining. It needs the following peice of code in there.

BELOW this:

// which type of images do you want to show
$q_switch = "random";


ADD THIS:

if ($forcats) {
$forcats = "AND cat = '$forcats'";
}


I already tested this and it works great. Kudos to Josh.


Coy can't seem to get away from me.
LOL

Yes well what would alot of people do around here without you to help them out
[]

Coy can't seem to get away from me. [/]

Thank goodness!

Thanks to Josh (and everyone involved) for the fix. I'll go give it a try now.
I never did get back here to comment that this fix still doesn't work for me. If I try to specify a category, I end up with no photos displaying at all. I've tried a bunch of different category numbers with no success.

Also, I just noticed that My Optional Stats box doesn't display all the stats it should. Currently, it says:

599 Registered User(s).; threads and page views.
324 photos posted with 22,536 page views.

You can see it's missing the total number of threads and page views. Have I set a path incorrectly? I tried to install the mod again using the most recent version in this thread, but the same thing happens.

Thanks, as always

http://www.iyarilimon.com/ubbthreads/ubbthreads.php
Coy,

Try this it works as I am using this on my site
if ($forcats) {
$forcats = "AND cat = '$forcats'";
}

Then as far as the most version of this hack. You forgot the first step! Your right though Michael's hack has this left out. I had to tweak a few things. There is a query you have to add to ubbthreads.php Check the hack and install the part in that file for the stats to show.
The most recent rendition of this hack is on page four.

Here is the code from the hack you need to add that your missing.

In Ubbthreads.php after:

// ---------------------
// Grab the tablewrapper
list($tbopen,$tbclose) = $html -> table_wrapper();

add this:

$sth = $dbh->do_query("
SELECT COUNT(B_Topic), SUM(B_Counter)
FROM {$config['tbprefix']}Posts
GROUP BY B_Topic
ORDER BY B_Topic
");
list($num_replies, $num_threads, $num_thread_views) = array(0, 0, 0);
$num_rows = $dbh->total_rows($sth);
if ($num_rows >= 1) {
list($num_replies) = $dbh->mysql_fetch_row($sth);
if ($num_rows >= 2) {
list($num_threads, $num_thread_views) = $dbh->mysql_fetch_row($sth);
}
}
$dbh->finish_sth($sth);
$num_posts = $num_threads + $num_replies;
Omegatron << Then as far as the most version of this hack. You forgot the first step! >>

You are absolutely correct -- I had neglected the ubbthreads.php portion of this mod. Unfortunately, now that I've added it (and verified that I've included the recent fix for displaying particular categories), it still isn't working.

As you know, I've had problems with other aspects of Photopost when mods are concerned. For now, I'll chalk this up to quirks of my system, and ask Josh to do some investigative work for me while he works on my elusive "table wrappers" issue.
Hi All,

It has been a while since I actively added anything here, but this hack has a serious !!! security issue in it.

I will not post it here but I should be very carefull in applaying it as it gives others some most usefull info.

I sended a PM to omegatron about it.

Best Regards,
Boris
That is just so weird. All the thing in ubbthreads.php is a query to get the totals. The defined output is called in the table in the template. I tell you YOU AND PHOTOPOST have issues.
Boris it isnt my hack but I have modified the version here of mine on page 4 with a fix for this security hole. I have emailed the main author of this program to place this fix on all of his sites and his version of the hack as well.

Thanks for the heads up.

Although one can see the MYSQL password info. If everyone sets their host to localhost which everyone does anyway there is no way for them to use the information they can see. However it is best to move that into a PHP file which I did and then set a require statement in the template to use such said file.
[]Coy,

Try this it works as I am using this on my site
if ($forcats) {
$forcats = "AND cat = '$forcats'";
}

Then as far as the most version of this hack. You forgot the first step! Your right though Michael's hack has this left out. I had to tweak a few things. There is a query you have to add to ubbthreads.php Check the hack and install the part in that file for the stats to show.
[/]

Omegatron.... my fix doesn't work if you want to list more than one category like this:

$forcats = "511,507,522";


Modify the code like this:

if ($forcats) {
$forcats = "AND cat in ($forcats)";
}


That will allow for multiple categories to be included.

Coy's problem was that she was listing the main categories... which had no photos.... you have to list the category number of the subcategory which actually has the photos.
LOL I thought I pasted the new code in their. To many freaking files. I do know it works though as I am using it
Anybody encounter and fix the issue with Username changes in UBBT, which does not change the username in Photopost?

I allowed several name changes and now have users wanting to re-upload ther same photos under their new name.

Thanks
Mike,

Try this fix and you should be set.

Okay at line 1067 find this code:

if ( $Globals['vbversion'] == "w3t6" ) {
$profilelink = "{$Globals['vbulletin']}/showprofile.php?Cat=&User=$tusername&Number=$tuserid";
$postreply = "<font color="{$Globals['headfontcolor']}" face="{$Globals['mainfonts']}" size="{$Globals['fontmedium']}"><b>Post a Reply</b></font>";
}
else {
$profilelink = "{$Globals['vbulletin']}/showprofile.php?Cat=&user=$tusername";


REPLACE WITH:

if ( $Globals['vbversion'] == "w3t6" ) {
$profilelink = "{$Globals['vbulletin']}/showprofile.php?Cat=&User=$tuserid";
$postreply = "<font color="{$Globals['headfontcolor']}" face="{$Globals['mainfonts']}" size="{$Globals['fontmedium']}"><b>Post a Reply</b></font>";
}
else {
$profilelink = "{$Globals['vbulletin']}/showprofile.php?Cat=&user=$tuserid";
Chuck,

Thanks for the quick response.

That fix allows me to interact with the UBBT DB from PP, but I don't know that it will correct the underlying issue...
- Username "AA" establishes a member gallery and photos are referenced as "Member: AA"

- User AA changes display name to "BB" in UBBT

- Photopost gallery still refernces "Member: AA".

The link in PP will bring you to the correct member profile in UBBT, but the point is that the photos in PP are referencing another name than what the user is now displaying.

As I do this.... I remembered that I chose to access the UBBT DB through PP, but I use a seperate MySql DB for PP. I thought using a seperate MySql would be easier if I ever had to split the UBBT and PP onto different servers due to high demands.

Mike

Give me a few to look through the files and see what I can find out.
Code
    $num_rows = $dbh->total_rows($sth);<br />    if ($num_rows >= 1) {<br />        list($num_replies,$num_thread_views) = $dbh->mysql_fetch_row($sth);<br />        if ($num_rows >= 2) {<br />            list($num_threads) = $dbh->mysql_fetch_row($sth);<br />        }<br />    }


I had to make a slight change to this section to get the right numbers to show up.
Cool you are the php guru

I can't wait till you upgrade to 6.2 so we can finally get the lightbulbs to work right.
Code
   $userob = new user; <br />   $user = $userob -> authenticate("U_FrontPage, U_Groups, U_TimeOffset,U_Display,U_Favorites,U_WhichForums,U_Categories,U_Number"); <br />        $Username = $user['U_Username']; <br />   $UserID = $user['U_Number']; <br />


You need this piece in the ubbthreads.php and the light bulbs will work. Notice the addition on U_Number and the assignment of $UserID
Sweet!!

Knew it was something simple. You the man!!
© UBB.Developers