More on editing {GALLERY} or theme.php More on editing {GALLERY} or theme.php
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

More on editing {GALLERY} or theme.php

Started by Thats Me, July 20, 2006, 07:29:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Thats Me

Hello, I have a follow-up question to this post. I'll start with the other poster's example of wanting to edit the bit of html (remove the bold, I believe) surrounding the headings "Categories", "Albums", and "Files". Here's what was suggested:

Quote- if you want to change somthing you should change it on themes/yourtheme/theme.php
- both texts are under $template_cat_list variable
- check your theme.php for $template_cat_list and if you don't have it copy it from sample/theme.php to your theme.php and   tweak it....

I can see exactly what you're talking about and editing this html is super simple. But, what if I want to edit the actual text used for these headings. Well, that's not actually what I want to do. What I want to do is edit the actual text being used for the sys- and sub-menus. I can see the html surrounding these in the theme.php file, but the labels still appear to be smarty tags. Where do I find the reference to the actual text used for these tags?

And my second issue is this: The theme I'm using has basically nothing in it's theme.php file. So, do I need to copy the entire text of the sample's theme.php file? That's a gigantic file. Do I need all that? I tried adding just a couple of functions but ended up with errors. I don't know nearly enough about php to understand what the problem was. But maybe I do need to just copy the entire file...?

Thanks for any help, I really appreciate it.

Nibbler

You only need to copy what you want to change, but you must copy entire functions or entire templates. The tags are not smarty, but it's the same principle. Search the code to find where the tags are replaced. You may also be able to replace the text via the language system, see eg. lang/english.php

Thats Me

Quote from: Nibbler on July 20, 2006, 07:33:07 PM
You only need to copy what you want to change, but you must copy entire functions or entire templates. The tags are not smarty, but it's the same principle. Search the code to find where the tags are replaced. You may also be able to replace the text via the language system, see eg. lang/english.php

Ahh, yes. The language file. That's the one. Thanks.

So, is there a rule of thumb about how to tell if you have an entire function coppied? I was pretty sure I had, but I still got an error (can't remember what it was now). Should I just copy the entire sample theme.php into my water_drop theme folder? No, I think I would end up with stuff being called or activated that shouldn't be. I'll just work with it and if I come across an error that I can't weed out, I'll search/post for help.

Thanks again :)

Nibbler

Copying the entire sample theme probably won't do you any harm, but you lose the advantages of the new lighter theme system. functions look like this


function somename(){

...

}


and templates are


$template_name = <<< EOT

...

EOT;


If you get a parse error then you probably copied it wrong. If you get a coppermine error then we can help you with it.

Joachim Müller

When copying functions, just look at the curly brackets - there must be the same number of opening an closing brackets. A good thing to check is the indentation.

Examples:
function foo() {
   return 'hello';
}
function bar($some_var) {
  a_sample_function($some_var);
}
sample_function_that_contains_loops($var) {
    if ($var == 1) {
        print 'The var equals one';
    } else {
        print 'Oh, the var doesn\'t equal one. Maybe it is two or three...';
    }
    // a comment - it will do nothing
    //Let's count up to the var
    for ($i=1; $i <= $var; $i++) {
        print $i;
        print '<br />';
    }
}
You get the idea, don't you?

Thats Me

Yes, that does clarify it for me. I think I can handle adding only the functions/templates I need.

Thanks again guys, very helpful!