Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: adding and modifying pages for dummies  (Read 6425 times)

0 Members and 1 Guest are viewing this topic.

albrum

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
adding and modifying pages for dummies
« on: March 12, 2007, 10:50:54 pm »

Sorry, I know you don't like giving individual support so is there anywhere that gives simple step by step instructions on how to edit and add buttons (along with pages) to those of us that know nothing about php and html?

I have installed the miniCMS plugin but it only seems to let me create pages, I want to edit a template as well. I have looked at the thread about adding buttons using miniCMS but it still leaves me a little baffled. I'm using the igames theme at www.al-birmingham.co.uk

Thanks for any pointers you can give me, as I said I know you don't like puppywalking guys like me so if you know of a place that does? Failing that where can I find php tutorials for dummies?

Al
« Last Edit: March 16, 2007, 04:46:16 pm by Nibbler »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: adding and modifying pages for dummies
« Reply #1 on: March 13, 2007, 07:48:27 am »

There's no need to know PHP if you just want to add some links to your template. Edit themes/yourtheme/template.html with a plain-text editor. All you need to know is HTML. For details, post what you actually want to see accomplished, i.e. what buttons you want to see at which place.
Logged

albrum

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: adding and modifying pages for dummies
« Reply #2 on: March 13, 2007, 10:08:52 am »

I really appreciate this,
In igames I want to add a 'Links page' and button and an 'about me' page and button. The buttons need to be in the same line as the 'top rated/most viewed' buttons ie where the custom link button gets put.

I have used the custom link option already. I'm assuming that once the button line is sorted I just need to work out how to point the buttons at the right place and then use the template.html to create the new pages?

I have adobe GoLive of which I have some limited knowledge or MS notepad etc.

Al
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: adding and modifying pages for dummies
« Reply #3 on: March 13, 2007, 08:13:21 pm »

You need to edit your themes.php code.

As an example I have added a homepage button to my test setup http://www.windsurf.me.uk/cpgtest/index.php

this was simply done by inserting the following code in the igames themes.php

Code: [Select]
<td class="top_menu_bttn">
                                                <a href="http://www.windsurf.me.uk" title=Homepage>Homepage</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">

You can add more buttons by repeating the above code and edditing as needed and adjusting this line
Code: [Select]
<a href="http://www.windsurf.me.uk" title=Homepage>Homepage</a> to your details

Logged
It is a mistake to think you can solve any major problems just with potatoes.

albrum

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: adding and modifying pages for dummies
« Reply #4 on: March 14, 2007, 11:23:05 pm »

Ok Phill, but where in the themes.php do I put the code? Anywhere?

I've tried changing the template.html file but I keep getting this www.al-birmingham.co.uk/wrongindex.html , how come the words in brackets appear instead of the buttons?

I did say at the start of this thread that I am a coding dummy, I really appreciate all the help and advice.

Al
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: adding and modifying pages for dummies
« Reply #5 on: March 15, 2007, 08:51:14 am »

Edit http://www.al-birmingham.co.uk/themes/igames/theme.php (using a plain-text editor), find
Code: [Select]
// HTML template for template sub_menu
// special note: I left the JavaScript 'hide' off of the first and third buttons to help avoid trouble keeping sys_menu open. :Donnoman
if ($CONFIG['custom_lnk_url'] != '') {
$template_sub_menu = <<<EOT
                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
<!-- BEGIN custom_link -->
                                                                                <td class="top_menu_left_bttn">
                                                <a href="{CUSTOM_LNK_TGT}" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
<!-- END custom_link -->
                                        <td class="top_menu_bttn">
                                                <a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="javascript:;" onmouseover="MM_showHideLayers('SYS_MENU','','show')">@</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{LASTUP_TGT}" title="{LASTUP_LNK}">{LASTUP_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{LASTCOM_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{LASTCOM_LNK}">{LASTCOM_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{TOPN_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{TOPN_LNK}">{TOPN_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{TOPRATED_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{TOPRATED_LNK}">{TOPRATED_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{FAV_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{FAV_LNK}">{FAV_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_right_bttn">
                                                <a href="{SEARCH_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{SEARCH_LNK}">{SEARCH_LNK}</a>
                                        </td>
                                        <td width="100%">&nbsp;</td>
                                </tr>
                        </table>
EOT;

} else {

$template_sub_menu = <<<EOT
                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
<!-- BEGIN custom_link -->
<!-- END custom_link -->
                                        <td class="top_menu_left_bttn">
                                                <a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="javascript:;" onmouseover="MM_showHideLayers('SYS_MENU','','show')">@</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{LASTUP_TGT}" title="{LASTUP_LNK}">{LASTUP_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{LASTCOM_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{LASTCOM_LNK}">{LASTCOM_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{TOPN_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{TOPN_LNK}">{TOPN_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{TOPRATED_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{TOPRATED_LNK}">{TOPRATED_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{FAV_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{FAV_LNK}">{FAV_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_right_bttn">
                                                <a href="{SEARCH_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{SEARCH_LNK}">{SEARCH_LNK}</a>
                                        </td>
                                        <td width="100%">&nbsp;</td>
                                </tr>
                        </table>
EOT;
}
and add the code that Phil suggested. This is plain HTML, as I suggested. I will give you an example: If you want to add a link to Google, find
Code: [Select]
<!-- BEGIN custom_link -->
                                                                                <td class="top_menu_left_bttn">
                                                <a href="{CUSTOM_LNK_TGT}" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
<!-- END custom_link -->
and add before it (in a new line)
Code: [Select]
                                                                                <td class="top_menu_left_bttn">
                                                <a href="http://google.com/" title="Let's go to Google">Google</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
As there is a conditional at athe very top that checks if a custom link exists or not, you'll have to perform another edit: find
Code: [Select]
<!-- BEGIN custom_link -->
<!-- END custom_link -->
and add the code I suggested above in a new line before it as well.

Doesn't get simpler than that.
Logged

albrum

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: adding and modifying pages for dummies
« Reply #6 on: March 15, 2007, 10:39:30 pm »

Fantastic!
That's the buttons issue sorted out and thanyou both very much indeed for your help.

Any ideas on why the template page isn't behaving? I'm not sitting back and waiting to be spoon fed on this btw, I keep plugging at it whilst waiting for your answers so if I crack it I'll let you know.

Al
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: adding and modifying pages for dummies
« Reply #7 on: March 15, 2007, 11:05:59 pm »

What do you mean by not behaving?
Logged
It is a mistake to think you can solve any major problems just with potatoes.

albrum

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: adding and modifying pages for dummies
« Reply #8 on: March 15, 2007, 11:48:11 pm »

Here is an example

www.al-birmingham.co.uk/wrongindex.html

The buttons don't appear, instead I get the menu names in brackets, weird, huh?
Logged

Nibbler

  • Guest
Re: adding and modifying pages for dummies
« Reply #9 on: March 16, 2007, 12:17:19 am »

To make new pages, use the code given here as your base, saving it as whatever.php. Then link to that.
Logged

albrum

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: adding and modifying pages for dummies
« Reply #10 on: March 16, 2007, 04:45:17 pm »

Gentlemen,
Thankyou so much for all your help, my problems are sorted thanks to you.
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 19 queries.