Previous Thread
Next Thread
Print Thread
Rate Thread
#311899 11/06/2006 6:43 PM
Joined: Jan 2003
Posts: 125
Journeyman
Journeyman
Joined: Jan 2003
Posts: 125
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.
Attachments
2291-panel.gif (51.87 KB, 140 downloads)
2297-2293-PhotoPostPanel-V0.2.zip (4.86 KB, 106 downloads)

Last edited by chillin; 11/16/2006 11:20 PM.
Sponsored Links
Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
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?

Joined: Jan 2003
Posts: 125
Journeyman
Journeyman
Joined: Jan 2003
Posts: 125
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]

Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
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?

Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
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.

Sponsored Links
Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
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
Attachments
2292-photo.gif (236 Bytes, 75 downloads)

Last edited by Zarzal; 11/07/2006 1:56 PM.
Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
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.

Last edited by Zarzal; 11/07/2006 3:07 PM.
Joined: Jan 2003
Posts: 125
Journeyman
Journeyman
Joined: Jan 2003
Posts: 125
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?
Attachments
2293-PhotoPostPanel-V0.2.zip (4.86 KB, 86 downloads)

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
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


- Allen wavey
- What Drives You?
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
haha, he won't up it for me, but he will for you, sad panda :x


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
I wouldn't? Must be something you said tipsy


- Allen wavey
- What Drives You?
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
usually is wink


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Jan 2003
Posts: 125
Journeyman
Journeyman
Joined: Jan 2003
Posts: 125
i asked very nicely.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.

Joined: Dec 2002
Posts: 67
Power User
Power User
Joined: Dec 2002
Posts: 67
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?

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Are your server logs showing any errors?


- Allen wavey
- What Drives You?
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
And did you apply my two fixes above? I had the same problem (blank no photos) until I made those minor adjustments.

Joined: Dec 2002
Posts: 67
Power User
Power User
Joined: Dec 2002
Posts: 67
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 ] "
Attachments
2363-calpy_photopost_prob.jpg (23.45 KB, 146 downloads)

Last edited by Calpy; 02/13/2007 3:41 PM. Reason: Added image
Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
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

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Feb 2004
Posts: 182
Member
Member
Joined: Feb 2004
Posts: 182
With me the update has run without problems and PhotoPost BB Code Popup functions without problems! laugh

Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
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?

Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
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.

Last edited by Zarzal; 05/18/2008 1:54 PM.
Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
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?

Joined: May 2008
Posts: 18
Newbie
Newbie
Offline
Joined: May 2008
Posts: 18
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

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
What popup do you mean? We have them in a Content Island, but no popups.


- Allen wavey
- What Drives You?

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)