Mod Name / Version: PhotoPost / ReviewPost Integrated Index V3.1
Description: Allows users of PhotoPost and/or ReviewPost to add their categories onto their Threads Main Index (with "featured" photos and reviews).
V3 improves on the V2 and prior works by substantially reducing the number of queries used - in my case going from 80 queries to a handful.
Working Under: UBB.Threads 6.1-6.2-6.3
Mod Status: Finished
Any pre-requisites: PhotoPost and/or ReviewPost
Author(s): PhotoPost
Date: 10/15/03
Credits: Michael Pierce, Omegatron
Files Altered: ubbthreads.tmpl
New Files: ubbt_photopost.tmpl, ubbt_reviewpost.tmpl, photopost.inc.php, reviewpost.inc.php
Database Altered: none
Info/Instructions: The new layout also drops the overhead of a connect request and instead simply does a select_db to use the PhotoPost/ReviewPost databases.
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.
At the end of your instructions, you say to adjust the $Globals['pp_db_prefix'] = ""; line in the template if my default table prefix was changed, but I can't find any reference to this line anywhere.
Well if you made the changes I stated above you would connect to the database as long as ya got the right database user and password defined in your photopost.inc.php.
I have attached the Photopost Template exactly how it should be per the mod. Place your prefix at the top of the file and set path to the include file and upload.
I had the template changes right, but the problem (or one of them) was that the photopost.inc.php file never had a reference to database user or password.
to that file and got it to start to work.... it now shows "featured photos" but errors out after that:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/xxx/public_html/folder/templates/default/ubbt_photopost.tmpl on line 121
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/xxx/public_html/folder/templates/default/ubbt_photopost.tmpl on line 132
OK the problem with not connecting to the database had to do with the fact that there is no reference to username or password in the photopost.inc.php file, so I added it as I described above, and it then was able to connect.
(Just so you know, your sample reviewpost.inc.php is nothing like the one included in the ZIP file for this mod.)
The errors I mentioned were a result of not being able to find the categories and Boards in the database. To find the Categories and Boards I had to add {$Globals['pp_db_prefix']} in a few other places in the ubbt_photopost.tmpl. I suppose this problem would have been nonexistent if I hadn't set my photopost installation up with a table prefix.
Delta my photopost.inc.php NOT REVIEWPOST is nothing like the one included I know. I said Michael ommitted the needed information as well as omitting the prefix data.
Using the include files and templates I posted everything works fine. I pulled them from my working site
I also noticed the whacky dates and the new photos thing. That's a little disconcerting but not a deal-breaker.
Another thing that I had trouble with in my earlier attempts with this was that I had a "hidden" (just visible to me) category I called "Purgatory" where I moved photos that didn't really fit in (I moved them to "Purgatory" rather than delete them outright in case of future disputes, as I do in Threads). Unfortunately that category showed up on the Threads index with this mod. I simply deleted that category for now so it wouldn't show up.
I'm not sure if this was just because of something I did or what (I did try different Photopost settings), but maybe somebody else will be able to verify this without me having to setup another "secret" photo board.
This mod doesn't use the security settings of PhotoPost to decide who can see what - although that would be a good modification, I havent had time to do it myself (yet).
Okay first post of this mod has been updated to reflect a change that was made to allow lastpost dates to display right.
Basically in laymans terms users where reporting dates being displayed of 12/31/69 which was the start of the unix timestamp translating to 0. This was happening because the lastpost data was being grabbed from the comments/reviews table. However any Photo/Products that had no reviews that column is 0. The changes allows the timestamp to be set by the comments first which of course would have the most current post and if null then set by the product lastpost column.
This is probably not possible - but it would be great to be able to include specific photopost categories - for example if the browser address bar said ...Cat=1&pCat=506 it would then show the photos from photopost category 506, along with threads category 1.
As I say probably not possible - but it would be nice
Since both system use the groups infrormation, you could add some security with a little work. Its been on my list, just not done yet.
One way would be to call authenticate(), but thats probably excessive. Another would be to call set_user_perms (i think thats it) with the userid and then use those variables to process the list.
Okay This hack has been updated to use NEWPOST/COMMENTS INDICATOR COUNTS JUST LIKE THREADS next to the total counts showing how many new since last login.
I tried adding this one line to ubbthreads.php to make the lightbulbs work: [] $UserID = $user['U_Number']; [/] but I got all these errors: [] Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/estrella/public_html/foros/templates/default/ubbt_photopost.tmpl on line 201
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/estrella/public_html/foros/templates/default/ubbt_photopost.tmpl on line 188
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/estrella/public_html/foros/templates/default/ubbt_photopost.tmpl on line 189 [/]
I removed that line from ubbthreads.php and the errors went away, but I'm not sure if the lightbulbs are working or not.
[]donJulio said: I tried adding this one line to ubbthreads.php to make the lightbulbs work: [] $UserID = $user['U_Number']; [/] but I got all these errors: [] Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/estrella/public_html/foros/templates/default/ubbt_photopost.tmpl on line 201
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/estrella/public_html/foros/templates/default/ubbt_photopost.tmpl on line 188
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/estrella/public_html/foros/templates/default/ubbt_photopost.tmpl on line 189 [/]
I removed that line from ubbthreads.php and the errors went away, but I'm not sure if the lightbulbs are working or not. [/]
The problem you are reporting is very strange indeed. I highly doubt that adding something like this $UserID = $user['U_Number']; which is just a defining statement really.
The later error is a mysql error and know issue with the sidebar hack. So if you are running the sidebar hack you might want to place this line with your database for threads on your last line right above ?>
mysql_select_db('DATABASE') or die("Could not select database 'DATABASE'\n");?>
I would try resetting the $UserID in ubbthreads again as your lightbulbs will never work unless you let threads know that the $UserID variable in photopost is equal to Threads U_Number field.
If you have any more questions contact me via PM. I know you have had problems in the past getting things set right and I have helped out.
I'm not using the IIP Sidebar Pal mod, so that can't be it. I'll try this over, just to see if it doesn't work itself out. -EDIT- Thank you for your offer, and also for solving the date problem with the last image uploaded not showing properly.
I installed this for ReviewPost and got similar errors to:
Code
<br />Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/estrella/public_html/foros/templates/default/ubbt_photopost.tmpl on line 201<br />
when I first installed. The fix was to enter the correct table prefix for my ReviewPost install into:
Also, is anyone else having problems with the newposts and nonewposts icons not updating properly? For me, anything with a product is permanently marked unread.
Thats why reading the directions would have helped you LOL
It states to set your table prefix. I dont beleive you did not read them. Also I sent you a private message on this at your site. You forgot to place $UserID = $user['U_Number']; in your ubbthreads.php file. Plus your files were old. I just updated this with the new post indicator's yesterday so your files had none of the coding. Your set.
JoshPet thats I will correct that. Thats an error on my part since the code is the same in both templates except the prefix statement and the rplink
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.