Not logged in. · Lost password · Register
Forum: Customising UNB Designs RSS
Custompage plugin
Grrr, argh!

Compose post

Username:
Subject (optional):
Verification code: VeriCode Please note the verification code from the picture into the text field next to it.
Please shorten the quotation to the essential to improve readability.
You are not logged in and writing this post as a guest.
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Smaller – Larger +
Text length: ? characters (Maximum: 10,000)
Post options
·
The last posts in this thread   (newest first, maximum 10 posts):
Avatar
Yves (Administrator)
User title: UNB developer & webmaster
Member since Jan 2004 · 3750 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Correct.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
NFG
Member since Sep 2006 · 111 posts
Group memberships: Members
Show profile · Link to this post
So the function name is unique to the 2 or 3 files generating the custompage, and are not used elsewhere in the codebase?  And, if I'm reading you right, I MUST change the names of these functions if I want to use more than one page.

Gotcha.  Making headway now, thanks for the assist.
Avatar
Yves (Administrator)
User title: UNB developer & webmaster
Member since Jan 2004 · 3750 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
It won't break anything if you do your work completely and also rename the function that is being referenced to in that call. If you won't rename that function, it will break if you use it in two plugins. Because all functions in plugins are in the global namespace, each functionname must be unique in all plugins you use.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
NFG
Member since Sep 2006 · 111 posts
Group memberships: Members
Show profile · Link to this post
Perhaps I wasn't clear:

UnbRegisterHook('page.custom.handlerequest', 'UnbHookCustomPageHandleRequest');

A search and replace for CustomPage would break the line above, and correct me if I'm wrong, but UnbHookCustomPageHandleRequest is something I shouldn't mess with, isn't it?  =)
This post was edited on 2008-03-05, 00:04 by NFG.
Avatar
Yves (Administrator)
User title: UNB developer & webmaster
Member since Jan 2004 · 3750 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
"custompage" is not an "internal process name" or somehow a static thing. You can change all of them. You need not change any, but then you may run into trouble when you want to use two custom pages...
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
NFG
Member since Sep 2006 · 111 posts
Group memberships: Members
Show profile · Link to this post
Subject: Custompage plugin
I'm trying to create my own custom pages for the forum, and running into difficulty when I try to figure out which instances of 'custompage' I should replace with the names of my own page.  I think it's confusing to have the name of the example page identical to the name of the internal process names. 

A straight search & replace would not only change the places it SHOULD, but also places like UnbHookCustomPageHandleRequest which I'm pretty sure shouldn't be changed!

It took forever to make it change the name on the tab.  Finally got that sorted and am now trying to sort out all the right instances of custompage to change...  Perhaps, Yves, you could make this easier in the future?  (Or am I just an idiot?  I leave that question to the philosophers!)

EDIT:
Yeah, I guess I just needed to keep trying.  A search and replace for every instance of  'custompage'  and @custompage was just about all of them.  Finally, I had to change plugins/custompage.inc.php as well.
This post was edited on 2008-03-03, 04:26 by NFG.
This board is powered by the Unclassified NewsBoard software, 20100516-dev, © 2003-10 by Yves Goergen
Page created in 264 ms (192 ms) · 50 database queries in 204 ms
Current time: 2010-09-10, 05:29:31 (UTC +02:00)