Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Oct 2002
Posts: 11
Junior Member
Junior Member
Offline
Joined: Oct 2002
Posts: 11
I hate being a newbie, but I guess we've all got to start sometime. Please forgive my ignorance!

I've been running UBB for a while, but I've never made any attempts to modify the code before now. I have programming experience and I can see that you guys have an impressive number of helpful files here as well, so that's all good.

My problem is a very basic one. As I'm thinking about what I want to change on my board (primarily cosmetic stuff), I have no idea what sorts of things would be easy or hard to do. I took a peek at the UBB files to get some idea of how it's all set up, but I am overwhelmed by the sheer number of files, especially cgi files, distributed among all those different directories. I have NO clue what all those files are for.

Is there a page or a thread somewhere around here that can give me a very basic, general breakdown of how UBB is set up? You know, like "this group of files is responsible for this, and that group of files is responsible for that." Basically, I just want to have some idea of what kinds of things would be difficult to change (because they'd require modifying so many files) versus what kinds of things would be easier to change.

I think this question is sounding really convoluted, so I'll just shut up now. Thanks!

Sponsored Links
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
I don't think there's a guide... but there is a pretty easy way to figure out what files you need to look at.

First, determine what you're trying to modify. Take a peek at the URL to this topic. The query string is: ubb=get_topic;f=26;t=002405

You'll want to pay attention to the stuff after ubb= - get_topic.

Open ultimatebb.cgi and search for the string "get_topic"

You'll find a few instances, the last probably being a block that looks something like this:

Code
if ($ubb eq 'get_topic') {
&RequireCode("$vars_config{CGIPath}/ubb_get_topic.cgi");
&get_topic($in{f}, $in{t});
exit(0);
} #end get_topic
So, we know that get_topic causes the ubb_get_topic.cgi to be loaded.

Opening that one up would be your first step to modifying a topic page.

However, this case is a little tricky. The get_topic subroutine does little more than determine if there's a cached copy, then either serves up the cache or makes a new file.

In order to create a new file, it has to do a RequireCode of ubb_lib_posting. lib_posting's create_topic subroutine has most of the magic you're looking to change.

The last step - you need to figure out which template is used by create_topic. Look for a call to &LoadTemplate. In this case, create_topic loads the public_topic_page template.

You can use this same technique to determine which files and templates are involved for any function. Find the call in ultimatebb.cgi, find the file referenced and the sub referenced, then find any further RequireCode or LoadTemplate calls in that sub.

Or, of course, you could just ask. smile

Oh - as there's no ubb= action for the forum summary (the list of cats & forums), the files involved are ubb_forum_summary and public_forum_summary. smile


UBB.classic: Love it or hate it, it was mine.
Joined: Oct 2002
Posts: 11
Junior Member
Junior Member
Offline
Joined: Oct 2002
Posts: 11
Awesome. Charles, you're great.

I've spent some time playing with the files, and I think I've gotten it pretty much figured out.

So now I have a follow-up question.

It seems that for many types of cosmetic changes, all that's required is to modify the relevant template(s). In some cases, though, that amounts to a lot of templates.

Suppose, for instance, I wanted to move the MainButtonsLine from the right side to the left side. I don't see any easy way around it; I'd have to modify a bunch of templates one at a time, although the change required for each template is extremely minor. Am I understanding this correctly, or am I overlooking something?

So assuming that I do have to modify a bunch of templates, are there any that I can skip over? I've seen it mentioned in various threads that certain templates are no longer in use by 6.3. Off the top of your head, do you know which ones?

I'll post my other random question in a separate thread. smile

Thanks again!!

--Justin

Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
No, you're (unfortunately) right. The header & footer code is NOT centralized. We plan to fix this the next time we work through the templates, which should be the release after 6.4.

Generally, if a template exists, it's in use. I believe the ones you're refering to are public_register_page and public_register_page_kid, though - those can be nuked...


UBB.classic: Love it or hate it, it was mine.

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
isaac
isaac
California
Posts: 1,157
Joined: July 2001
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)