UBB.Dev
MOD NAME: Photopost / ReviewPost and Ubbthreads Integrated Index Version 4

DESCRIPTION: Adds the Photopost Index and/or ReviewPost Index to Threads creating a seemless integration.

BY: Michael Pierce, Omegaton

DATE: 3-19-2003

CREDITS: Michael Pierce, Omegatron for XHTML compliance and updating for the tablewrappers and various bugfixes, JoshPet for bug fix with the forcats function.

VERSION: 4.0 for UBBThreads 6.2

REQUIREMENTS: A full version of UBB.Threads 6.2

COMPATIBILITY: UBB.Threads 6.2

DEMO: http://www.viperalley.com/ubbthreads.php

FILES MODIFIED: ubbthreads.php, ubbthreads.tmpl

NEW FILES: photopost.inc.php, ubbt_photopost.tmpl, reviewpost.inc.php, ubbt_reviewpost.tmpl

This new release builds on the preior work and also includes a version for the newly released ReviewPost. This Hack can be used to add one or both of the Integrated Index pages.

Attached File
73611-pp_rp_ubbt62.zip  (86 downloads)
Thanks Michael! Great work. Plan to utilize this myself shortly.
I think that seperating out the tmpl for each into their own files will make working with this hack much easier. Enjoy!
Cool Michael I see you have been busy with getting Reviewpost out the door. Great work with these.

Just two minor things. I mean real minor. There is one minor XHTML problem and here is the fix. You forgot the tr tag on the featured photo.

FIND in ubbt_photopost.tmpl

echo <<<UBBTPRINT
$tbopen
<tr class="darktable">
<td class="tdheader" colspan="5" align="center">
Featured Photos
</td>
</tr>


REPLACE WITH:

echo <<<UBBTPRINT
$tbopen
<tr class="darktable">
<td class="tdheader" colspan="5" align="center">
Featured Photos
</td>
</tr>
<tr>

2) This is a picky thing some people might like. Depending on their site colors etc they may not like the Photo background white so I did this

FIND: bgcolor=/"#FFFFFF/" and REPLACE WITH class=/"darktable/"
Thanks! Made those changes and uploaded a new ZIP!
Great work on ReviewPost looks like you outdid your on this one.
awesome! I can't wait to get it!
I must say the response has been amazing; we've had a tremendous volume of sales today on both of our products. As the only guy doing the coding for all three products, that makes me very happy.

And to think I already have 3.4 running on my test site!
well, for my site, it is the perfect addition. I could not have asked for anything more specific to my needs, other than maybe a 10 star rating system as opposed to five stars. It will need a tiny bit of customization, and maybe an extra field or two, but hey, I'm ecstatic as this is the first time something has came out that I wanted before I paid someone to have it custom done. Usually, it's right after.
thanks for the update to a great set of addons Michael
3.4 Michael??

Isn't 3.3 still in beta?

Or is 3.4 Review posts version number.
PhotoPost 3.3 has been released; PhotoPost 3.4 is under development already. ReviewPost 1.0 is the released version.
Cool I see that now I get to play and hack away at 3.3 to get it fully integrated into Threads cool.
I also wrote a snippet of code which I inserted in my index.php and showphoto.php/showproduct.php files which allows me to register people in these areas in the Who'se Online.

Basically, I saved the attachement as ubbt_online.php and then at the top of each PhotoPost/ReviewPost file I added:

include "ubbt_online.php";

Of course you have to add the "gallery" tag (or "reviews") to the languages/*/online.php files for the text to show up in the Who'se Online page.

$ubbt_lang['gallery'] = "Viewing Photo Galleries";
$ubbt_lang['reviews'] = "Viewing Product Reviews";

You can modify the "gallery" tag to put in "reviews" for ReviewPost.

Attached File
73798-whoonline.txt  (59 downloads)
The good part is going to be writing up the code to get Photopost to use Threads stylesheets and put the 7 new classes in those stylesheets. I worked on it a bit with the beta but now that 3.3 is done I better hurry up and finish.
I'm having trouble getting this to work :-(

I followed all the steps in the txt file very carefully, but I keep getting the following error:

[]Parse error: parse error in /home/virtual/site12/fst/var/www/html/forum/templates/default/ubbt_photopost.tmpl on line 47
[/]
(the path is correct)

I run version 3.2.1 of photopost and UBBt 6.2.2

What could have gone wrong here ?

Regards,

Pasquale
did you happen to delete the ; after the path

Here try downloading this template and edit the path and upload.

Attached File
74083-ubbt_photopost.tmpl  (77 downloads)
That worked! Thanks a lot....
(but I still don't see the difference between my tmpl file and yours)

Ciao,

Pasquale
You most likely have a stray ascaii character.
I have two categories in my forum and after installing this module, I have a table with 4 random photopost images below it. How can I place this table between my two categories in stead of below them ?
Can you post a url to your forums so I can see what you have?

By default you will have the threads forums then the picture index then the Photopost forums.
just purchased my copy! not sure where to download it though?
I hope this image makes it all clear
[]http://www.multifire.nl/example.jpg[/]
So what I would like, is to have the images between the two categories, and not below them...
This is the way it was designed. The Photopost template is placed after the Threads categories. I know I could place the random photos up top of Threads categories. To do what you suggest would require a bit more hacking as in removing a part of the Photopost hack and placing it in essence between the category loop to the next one but on multiple category boards this would look bad. I have like 7 categories so you see what I am getting at? If you must want to begin with the Photopost hack then list Threads do this

Find the UBBTPRINT; up the top of the ubbthreads.tmpl file
right after this and before the echo <<<UBBTPRINT place your line

require ("/PATH/TO/ubbthreads/templates/default/ubbt_photopost.tmpl");


A slight error in the instructions Michael

In the ubbt_photopost.tmpl:

Find
print "<td align="center" class=/"darktable/" width="20%">";
print "<br /><a href="". $url_path ."showphoto.php?photo=". $line["id"]. "">";
$temp_user = ($line["userid"]);

and change it to

print "<td align="center" class=\"darktable\" width="20%">";
print "<br /><a href="". $url_path ."showphoto.php?photo=". $line["id"]. "">";
$temp_user = ($line["userid"]);
That might have been me Nikos. Back on the first page I must have been dislexic.
LOL - It happens to the best of us Chuck!
Michael any idea why the categories would just dissapear. Photopost is running fine. The categories just up and dissapeared on this integration hack. The photo's are still there.
Indeed, both of these scripts are wonderful.

Quick question: is there a way to integrate the threads .css with both products? As in if a user has chosen a style sheet other than the default that the stylesheet will also be used in RP and PP?

A bit off topic but thought somebody might now how to do this...

chillin
Chillin,

I wrote up the hack for this. You can see it at my site.

http://www.reeftalk.com

Here is the link to the thread where the hack is located here in the Forum Design Integration forum.

https://ubbdev.com/forum/showfl...ew=collapsed&sb=5&o=&fpart=1
Is is possible to exclude a category from being shown on the index page ? I would need this because sometimes the random gallery shows pictures which are not very "suitable" for the main page

Thanks,

Pasquale
In ubbt_photopost.tmpl look for the code below

// leave blank for no customization, otherwise list cats you only want images to appear from
$forcats = "";

in between the quotes put the category NUMBERS for the ones you want listed example 502,504,503,501
That doesn't work. Here's my code:

[]// leave blank for no customization, otherwise list cats you only want images to appear from
$forcats = "500,502,503,504,505,506,507,510,513,514,515,516,517,518,519,520,521,523"; [/]

Even with one or less numbers I get "Query Failed" on the index page.

Thanks for helping me! []http://img.neoseeker.com/m/26412_photo.gif[/]
If you look at the $query below, you'll notice that you have to format the query in that string.

$forcat = "AND cat IN (500,502,503,504,505,506,507,510,513,514,515,516,517,518,519,520,521,523)";
Ok great, thanks!
But isn't it possible to exclude a certain cat ? Now I will always need to keep ubbt_photopost.tmpl up-to-date with new categories.... Also it seems to me that it slows down the query execution.
I have to be a pain in the arse and have different ubbthreads.tmpl coding. The section in question in the instructions looks slightly different in my code. Here is the area:

[]
</tr>
UBBTPRINT;
} //UBBTREMARK
echo <<<UBBTPRINT
<!-- END OF FORUM LOOP -->
$tbclose
<br />

UBBTPRINT;
} //UBBTREMARK
echo <<<UBBTPRINT
<!-- END CATEGORY LOOP -->

$tbopen
<tr>
[/]

I've tried sticking the code in various places to no avail. Any idears?
ulling out hair:
Here is what mine looks like for 6.2.3

What version are you running?

UBBTPRINT;
} //UBBTREMARK
} //UBBTREMARK
echo <<<UBBTPRINT
<!-- END CATEGORY LOOP -->
<!-- END OF FORUM LOOP -->
$tbclose
UBBTPRINT;
require ("/usr/local/blah/blah/blah/ubbt_photopost.tmpl");
echo <<<UBBTPRINT
<br />

Look for the close of the Threads category and forum tables and add this directly after filling the path in to the template

UBBTPRINT;
require ("/usr/local/blah/blah/blah/ubbt_photopost.tmpl");
echo <<<UBBTPRINT
<br />

I am running 6.3b4.

My template is different though, since I don't use the stock template.

I will attach my .tmpl file.

Attached File
81282-ubbthreads.zip  (15 downloads)
I've placed:
[]
UBBTPRINT;
require ("/home/drumlin/public_html/threads/templates/default/ubbt_reviewpost.tmpl");
echo <<<UBBTPRINT
<br />
[/]

Below:
[]
UBBTPRINT;
} //UBBTREMARK
echo <<<UBBTPRINT
<!-- END CATEGORY LOOP -->
[/]
and above:
[]
$tbopen
[/]
. . .and I get a "Query failed" and the rest of the page (footer) does not render.
And yes, my ubbthreads.php file does include:

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

$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;
[/]
Josh,

I run beta4 on my test site. This hack works fine. Your template is a bit whacked from a stock template. Here is where it needs to be. Add everything between the $tbclose and $tbopen

<!-- END CATEGORY LOOP -->
<!-- END OF FORUM LOOP -->
$tbclose
<br />
UBBTPRINT;
require ("/usr/local/blah/blah/blah/templates/default/ubbt_photopost.tmpl");
echo <<<UBBTPRINT
<br />
$tbopen

Also did you fill out the photopost.inc.php file with your settings and upload it to your threads directory?
Okay, but my code doesn't look like that.

But think I got it right with what I tried before. It still says Query failed though. So I think I have it in the right place in ubbthreads.tmpl, the problem is somewhere else.

I'm using this for ReviewPost, BTW. I filled-out and uploaded reviewpost.inc.php to the folder above my root. This is where I keep my config.inc.php file, and the instructions said to put it in the same folder. For good measure, I copied the file to my threads directory as well, but that did not help.
Thats right you took the free Reviewpost.

If it says Query failed then it is a MYSQL problem connecting. I would double check the settings.
Roger that.....
Settings are all correct

$rpurl_path...check
$rpdata_dir...check
$rphost...check
$rpuser...check
$rppassword...check
$rpdatabase...check

What file calls reviewpost.inc.php anyway?
The ubbthreads.tmpl calls reviewpost.tmpl and that template calls the reviewpost.inc.php

Attached File
81314-ubbthreads.txt  (115 downloads)
same for me
© UBB.Developers