UBB.Dev
Posted By: chillin PhotoPost BB Code Popup - 11/07/2006 1:43 AM
PhotoPost Popup
This was an old 6.x mod that myself, JustDave, and Omegatron had all worked on at some point in time.

It essentially add's a button to the rich text editor panel (that shows in all post/reply windows) which launches a pop-up panel with a user's photos that are in PhotoPost.

Once a photo is clicked, bbcode is placed in the post window to link the image.

[Linked Image]

Modified Files
/ubb_js/standard_text_editor.js
/templates/standard_text_editor.tpl

New Files
/scripts/photopost.inc.php
/templates/photopost.tpl
/languages/photopost.php

Requirements
UBB 7 and Photopost

Instructions
Follow the text file inside the zip.

Updated
Attached proper zip with bug fixes.

Attached picture 2291-panel.gif
Attached File
Posted By: Zarzal Re: PhotoPost BB Code Popup - 11/07/2006 5:56 PM
I need help smile I follow your instructions. Seems to be simpel but it dont work.
I get the extra tab in the editor but click to it bring only an error in the java console and no popup window:

error: x is not a function
error: openPhotoPanel is not defined

Maybe there is missing a file in your archive or missing instructions?
Posted By: chillin Re: PhotoPost BB Code Popup - 11/07/2006 7:11 PM
Sorry about that. I left out this step in standard_text_editor.tpl

Around Line 14 find this
Code

var enterImage = "{$lang.ENTERIMAGE}";
var enterItem = "{$lang.ENTERITEM}";
{literal}

ADD BELOW

Code

function openPhotoPanel() {
photoWindow=window.open('ubbthreads.php?ubb=photopost','photopanel','scrollbars=yes,resizable=yes,width=500,height=600');
if (photoWindow.opener == null) photoWindow.opener = self;
}

I'll update the instructions and upload the zip again.[i][/i]
Posted By: Zarzal Re: PhotoPost BB Code Popup - 11/07/2006 7:46 PM
ok, this brings up the popup window. It shows the correct layout and the buttons work, but I see no photos from my user. I setup photopost.inc.php as it should.

Only one thing is unclear. You put this code in it:
$pp_url="http://www.mysite.com/photopost/"; //url to photopost install NO trailing slash

You say NO slash but put it yourself at the end. I try both version with my own url but see no images. I dont get any error message so I be connected to the database. Any clues?
Posted By: Zarzal Re: PhotoPost BB Code Popup - 11/07/2006 8:10 PM
found another little problem, but this doesnt solve my main problem. In photopost.tpl is a hardcoded path, I use an other path to my board. I change it for me.
Posted By: Zarzal Re: PhotoPost BB Code Popup - 11/07/2006 8:52 PM
ah, got it. I use a table prefix 'pp_' and this is need in front of 'photos'. Please add a config option for the prefix to in photopost.inc.php

I like to share an propper icon too

Attached picture 2292-photo.gif
Posted By: Zarzal Re: PhotoPost BB Code Popup - 11/07/2006 9:02 PM
Next problem. The pagnation dont work. Seems to hardcodet to work with you board:

//Pagnation
$totalphotos = get_photo_total($user_id);
$TotalP = ceil($totalphotos / $pp_images);
$pages = $html->paginate($page,$TotalP,"tripreports{$var_sep}sb{$var_eq}$sb{$var_sep}sk{$var_eq}$sk{$var_sep}page{$var_eq}");

The result is an unuseable link like this:
http://www.dragonclan-forum.de/board/ubbthreads.php/ubb/tripreports/sb//sk//page/2

/edit: replace tripreports with photopost and it work as it should. Finished, well done.
Posted By: chillin Re: PhotoPost BB Code Popup - 11/07/2006 10:24 PM
Well, since I can't edit my original post, here is an updated zip file with all of zarzal's changes.

Allen/Admins... can we modify edit time in the Mod forums so we can update our original install files?

Attached File
2293-PhotoPostPanel-V0.2.zip  (86 downloads)
Posted By: AllenAyres Re: PhotoPost BB Code Popup - 11/16/2006 6:50 AM
I upped the limit to something like 100k hours - need to write something to disable edit times for certain forums smile

Nice mod, some great images on your site smile
Posted By: Gizmo Re: PhotoPost BB Code Popup - 11/16/2006 9:11 AM
haha, he won't up it for me, but he will for you, sad panda :x
Posted By: AllenAyres Re: PhotoPost BB Code Popup - 11/16/2006 6:08 PM
I wouldn't? Must be something you said tipsy
Posted By: Gizmo Re: PhotoPost BB Code Popup - 11/17/2006 3:24 AM
usually is wink
Posted By: chillin Re: PhotoPost BB Code Popup - 11/17/2006 6:18 AM
i asked very nicely.
Posted By: JoshPet Re: PhotoPost BB Code Popup - 01/10/2007 6:35 AM
Nice. One thing I noticed, $pp_prefix needs to be included in the global call of the functions or else the query doesn't see your table prefix. Thanks!
Posted By: JoshPet Re: PhotoPost BB Code Popup - 01/10/2007 6:55 AM
One more issue I noticed, in the photopost.tpl file, the URL to the javascript include is hardcoded with a ubb7 directory name, so clicking the image doesn't find the updatePost function until you fix this url.
Posted By: Calpy Re: PhotoPost BB Code Popup - 02/07/2007 11:50 PM
Thanks! Quick note, in the v 0.2 zip file photopost.inc.php, localhost is misspelled on line 12.
Now, for me (running UBBT 7.1b5) it opens a window that says "My PhotoPost Pictures", but there are no pics displayed, just the heading and then the two buttons at the bottom. When I go directly to my photopost install, I am logged in and have pix in my gallery. Any thoughts on why it's not finding any pix?
Posted By: AllenAyres Re: PhotoPost BB Code Popup - 02/08/2007 4:50 AM
Are your server logs showing any errors?
Posted By: JoshPet Re: PhotoPost BB Code Popup - 02/08/2007 8:25 AM
And did you apply my two fixes above? I had the same problem (blank no photos) until I made those minor adjustments.
Posted By: Calpy Re: PhotoPost BB Code Popup - 02/13/2007 10:37 PM
Originally Posted by JoshPet
And did you apply my two fixes above? I had the same problem (blank no photos) until I made those minor adjustments.

Hi Josh, I did the javascript/URL fix just now. The $pp_prefix already seems to be in the v.2 zip file version of photopost.inc.php, and as a test I just hard coded "pp_photos" in place of the two occurrences of the variable in the page as well, but still just a popup with some options but no photos.
Allen, my server error log is empty... which is actually kinda weird, considering I must have some broken image links or something somewhere in my thousands of pages.
"Error Log
Last 300 Error Log Messages in reverse order:



[ Go Back ] "

Attached picture 2363-calpy_photopost_prob.jpg
Posted By: Zarzal Re: PhotoPost BB Code Popup - 02/15/2008 5:41 PM
This need an update to work with 7.3
After I take a look to the beta4 code I see changes in templates/default/standart_text_editor.tpl and /ubb_js/standard_text_editor.js that need to review by someone. The way javascript is handled was changed a little bit.

Anyone have time to do it? This is one of two things that stopped me right now to bring my page on 7.3
Posted By: Gizmo Re: PhotoPost BB Code Popup - 02/16/2008 2:24 AM
If i had a copy of PhotoPost to work with I'd gladly give it a shot; but unfortunately I prefer Gallery as it's free wink
Posted By: Micky Re: PhotoPost BB Code Popup - 02/16/2008 12:12 PM
With me the update has run without problems and PhotoPost BB Code Popup functions without problems! laugh
Posted By: Zarzal Re: PhotoPost BB Code Popup - 02/17/2008 1:29 PM
ok. Sounds fine. I will see if 7.3 ist released. Do you encounter the same problem as Moers here?
http://www.ubbcentral.com/forums/ubbthreads.php/topics/206547.html

He say that he only can upload pictures as admin. Do you can test it and report back in the thread?
Posted By: Zarzal Re: PhotoPost BB Code Popup - 05/18/2008 7:12 PM
It dont work anymore with 7.3 release. I get permission errors. Anyone use it successfully with 7.3 final version?

If I try in my browser a direct call with ubbthreads.php?ubb=photopost it work but If I click the icon in the editor I get a permission error.

It would also very nice to include it in the picture button dropdown of the editor.
Posted By: Zarzal Re: PhotoPost BB Code Popup - 05/18/2008 9:06 PM
I found the problem. In /templates/default/standard_text_editor.tpl is the following code:
Code
{literal}
function openPhotoPanel() {
photoWindow=window.open('ubbthreads.php?ubb=photopost','photopanel','scrollbars=yes,resizable=yes,width=500,height=600');
if (photoWindow.opener == null) photoWindow.opener = self;
}
{/literal}
The problem: there iss missing the base dir in front of ubbthreads.php?ubb=photopost. For a workaround I hardcode it for me like this: /board/ubbthreads.php?ubb=photopost
This work.
But what ist the propper way to enter it inside a function? I try {$config.BASE_URL}/ubbthreads.php?ubb=photopost but this dont work. Who can help?
Posted By: Iann128 Re: PhotoPost BB Code Popup - 11/15/2008 9:24 PM
I just installed Photopost on my testing site (ubb v7.4.1) and am getting the popup window with no pictures in it as well.. I have tried the fixes above and can not seem to figure it out.

Allen I have checked out your site and love the way you have it working, that is one of the reasons we bought Photopost.

The site I am trying to get it working on is http://testing.firstgenmc.com/ubbthreads

Thanks,

Ian
Posted By: AllenAyres Re: PhotoPost BB Code Popup - 12/01/2008 5:41 PM
What popup do you mean? We have them in a Content Island, but no popups.
© UBB.Developers