Not logged in. · Lost password · Register
Forum: Customising UNB Designs RSS
Custompage plugin
Grrr, argh!
Reply
Avatar
Reply · Quote NFG #1
Member since Sep 2006 · 105 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.
Avatar
Reply · Quote Yves (Administrator) #2
User title: UNB developer & webmaster
Member since Jan 2004 · 3740 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
Reply · Quote NFG #3
Member since Sep 2006 · 105 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
Reply · Quote Yves (Administrator) #4
User title: UNB developer & webmaster
Member since Jan 2004 · 3740 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
Reply · Quote NFG #5
Member since Sep 2006 · 105 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
Reply · Quote Yves (Administrator) #6
User title: UNB developer & webmaster
Member since Jan 2004 · 3740 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... ♪♬
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please note the verification code from the picture into the text field next to it.
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Reply
Go to forum
This board is powered by the Unclassified NewsBoard software, 20100516-dev, © 2003-10 by Yves Goergen
Page created in 204 ms (156 ms) · 69 database queries in 136 ms
Current time: 2010-07-30, 10:48:33 (UTC +02:00)