4images Forum & Community
4images Modifications / Modifikationen => Templates & Styles (Requests & Discussions) => Topic started by: nicky9 on May 06, 2008, 10:23:58 AM
-
Have been looking on the forum, but haven't found any real menu. I mean like a left-side menu with several menu-buttons with text that are shown in the main-frame when pressing the menu-buttom.
Also, a footer-menu with items like Contact Us | Cookies | Terms etc. etc.
-
Hello;
it should be possible, extending your template.
Here is an example, using the default template.
- First, edit the file includes/page_header.php
At the end of this file, just before the closing:
?>
add these lines:
//---------------------------------------------------------------------------------------------
//---- Template my_menu.html ------------------------------------------------------------------
//---------------------------------------------------------------------------------------------
$my_menu = $site_template->parse_template("my_menu");
$site_template->register_vars(array(
"my_menu" => $my_menu
));
unset($my_menu);
//---------------------------------------------------------------------------------------------
//---- Template my_footer.html ----------------------------------------------------------------
//---------------------------------------------------------------------------------------------
$my_footer = $site_template->parse_template("my_footer");
$site_template->register_vars(array(
"my_footer" => $my_footer
));
unset($my_footer);
- Now, go to templates/your_template/ folder.
_____Create a first file called "my_menu.html", with this example code:
<div align="center">
<table width="100" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="center" height="17" background="{template_url}/images/button.gif" ><a href="index.php" style="text-decoration: none"><strong>First link</strong></a></td>
</tr>
<tr>
<td width="100%" align="center" height="17" background="{template_url}/images/button.gif" ><a href="index.php" style="text-decoration: none"><strong>Second link</strong></a></td>
</tr>
<tr>
<td width="100%" align="center" height="17" background="{template_url}/images/button.gif" ><a href="http://www.mysite.com/" style="text-decoration: none"><strong>Partner</strong></a></td>
</tr>
</table>
</div>
<br>
You will need also to copy this image: (http://www.ami07.info/images/button.gif), into your_template/images/ directory.
_____Create another file called "my_footer.html" with this code:
<br /><div align="center">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="head1">
<td width="25%" align="center" class="row1"><a href="contact.php">Contact us</a> </td>
<td width="25%" align="center" class="row2"><a href="cookies.php">Cookies</a></td>
<td width="25%" align="center" class="row1"><a href="terms.php">Terms</a></td>
<td width="25%" align="center" class="row2"><a href="wazza.php">Etc...</a></td>
</tr>
</table>
</div>
- Now, you're able to call {my_footer} and {my_menu} in any of your other template pages.
Example: open your_template/home.html file/
Find:
{endif random_image}
Add this:
{my_menu}
Find:
{footer}
Add BEFORE:
{my_footer}
I've done this with the default menu, as I said, and had this:
- My_menu display: (http://www.ami07.info/images/my_menu.png)
- My_footer display: (http://www.ami07.info/images/my_footer.png)
Once done, you just have to modify the file my_menu.html or my_footer.html once to get the modification in the whole template.
I'm sure you will be able to custom it as you prefer.
Please find in attachment the modified page_header.php, version 1.7.6 and the template files and image.
Salutations.
-
Thanx a bunch ! ! :D
I'll try it out.
-
... perfect manurom ... :D
... this should be a tutorial ... in the right forum ... !
-
Perhaps somebody with the right energy should put together all the essentials in a manual? :P
-
Perhaps somebody with the right energy should put together all the essentials in a manual? :P
Keep on looking at the tutorials forum here: Tutorials (http://www.4homepages.de/forum/index.php?board=31.0).
Mawenzi and others are making a great job. But be patient, they've just begun.
-
Hi,
one question? do you lose with this links the session?
I thing it is better looks like the link tags:
in includes/page_header.php
search:
"url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),
after add:
"url_therms" => $site_sess->url(ROOT_PATH."therms.php"),
search:
"charset" => $lang['charset'],
after add:
"lang_therms" => $lang['therms'],
add in lang/my_language/main.php:
$lang['therms'] = "Therms";
add in my_menue.html, where do you like the link:
<a href="{url_therms}">{lang_therms}</a>
And why do I have to add these things that KurtW added?
- You logged in with a seesion id and with this links you lost it.
- Multi language possible
KurtW
-
Hi, Kurtw;
my bad! :oops:
Did answer too much too quickly, but not checked enough.
You're totally right.
-
Excuse me for being a complete newbie in this, I get the following error message:
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/mycelebp/public_html/includes/page_header.php on line 397
Does it have anything to do with the ROOT_PATH in the following line? Whould it be replaced with the real rootpath or something?
(Line 397) "url_therms" => $site_sess->url(ROOT_PATH."therms.php"), (That last , should be a ; I guess?)
Also, where exactly do I put the <a href="{url_therms}">{lang_therms}</a> ? Just after <div align="center"> in my_meny.html?
And why do I have to add these things that KurtW added?
-
Hi,
please look at my last post...
KurtW
-
Thanks a lot, now I get no error message. :P
I'm not really sure I understand everything though. First of all, I'm only going to use one language, do I then have to add all the code you recommended? Or can I go with Manurom's original code only?
"- You logged in with a seesion id and with this links you lost it."
What does that mean?
What is "therms"? Do you mean terms? I guess it's one of the menus-items I'm supposed to add? And then I'm supposed to add more of them by myself, like "contact us" etc? And for every menu-item I have to add more code to main.php, my_menu.html etc but with "therms" exchanged to other menu-items?
Treat me like a child and I understand... :roll:
-
Regarding this line:
<td width="25%" align="center" class="row1"><a href="contact.php">Contact us</a> </td>
I'm not really sure how to implement contact.php. Should't it be contact.html? And then I have to have the entire webpage within that contact.html? And just write my own text in the main frame about contact?
-
Have you got existing pages for terms of use, contact form, or any other stuff?
-
Ehh... no, I don't know how to do it. I'm completely new to this.
Do I add templates like contact.html, about.html and have them all similair with everything in it (toplogo, leftmenu, footer etc) except for the text in the main frame? Or how do I do it?
-
Hello;
- About contact, you'll have to install something like this: [MOD] Contact Form (http://www.4homepages.de/forum/index.php?topic=8987.0).
In this case, you will have to use links like KurtW said, to link to a "contact.php" file, keeping user's session alive.
_____Or else, let your visitor use its emailing software, using a link like this in your menu or footer:
<a href="mailto:me@myhost.com">Contact us</a>
- About about.html, look at the FAQ of the forum (http://www.4homepages.de/forum/index.php?board=14.0): How to add a new, custom template page (http://www.4homepages.de/forum/index.php?topic=4996.0)
_____For links to external sites, like partners, you may use this in your menu or footer:
<a href="http://www.my_partner.com/" target="_blank">My partner</a>
By the way, I think you should be better helped if you could tell us how many links you'd like tu use, and precisely for what use.
You could have a help for anyone of them in an only post, I hope.
-
Ok, so if I'm logged in I will with the first code somehow loose "the session"? (Whatever that means? Does it mean I might get logged out or something?)
I plan to add this:
(Left menu)
HOME
FAQ
TOP IMAGES
NEW IMAGES
and if you're logged in, it would be good to also have these menu items:
MY ALBUM (instead of lightbox)
CONTROL PANEL
LOG OUT
(Footer)
About Us | Contact Us | Terms | Privacy | Cookies | Copyright
Should I basically totally skip the first code Manurom wrote and only use the code KurtW provided?
-
So how do to? :P
-
Hello, nicky9;
sorry if we made you confused.
Let's make it step by step, according to KurtW's advice.
1_ LEFT MENU
____You got there 3 core and one custom links.
This custom link is "FAQ", and there you can do a custom template page by reading this FAQ: How to add a new, custom template page (http://).
Once having created your own template page called "FAQ.html" (caution, case sensitive), your template file "my_menu.html" should be like this:
<div align="center">
<table width="100" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="center" height="17" background="{template_url}/images/button.gif" ><a href="{url_home}" style="text-decoration: none"><strong>HOME</strong></a></td>
</tr>
<tr>
<td width="100%" align="center" height="17" background="{template_url}/images/button.gif" ><a href="{url_home}?template=FAQ" style="text-decoration: none"><strong>FAQ</strong></a></td>
</tr>
<tr>
<td width="100%" align="center" height="17" background="{template_url}/images/button.gif" ><a href="{url_top_images}" style="text-decoration: none"><strong>TOP IMAGES</strong></a></td>
</tr>
<tr>
<td width="100%" align="center" height="17" background="{template_url}/images/button.gif" ><a href="{url_new_images}" style="text-decoration: none"><strong>NEW IMAGES</strong></a></td>
</tr>
</table>
</div>
<br>
2_ IF LOGGED
____You want to have "MY ALBUM", in user_logininfo block, instead of "Lightbox".
Go to the lang/your_language/ (english, I suppose) directory, and edit the file "main.php"
Find:
//-----------------------------------------------------
//--- Lightbox ----------------------------------------
//-----------------------------------------------------
$lang['lightbox_no_images'] = "No images stored in your lightbox.";
$lang['lightbox_add_success'] = "Image added.";
$lang['lightbox_add_error'] = "Error adding image!";
$lang['lightbox_remove_success'] = "Image deleted from lightbox.";
$lang['lightbox_remove_error'] = "Error deleting image!";
$lang['lightbox_register'] = "In order to use the lightbox, you have to register.<br />» <a href=\"{url_register}\">Register now</a>";
$lang['lightbox_delete_success'] = "Lightbox deleted.";
$lang['lightbox_delete_error'] = "Error deleting lightbox!";
$lang['delete_lightbox'] = "Delete lightbox";
$lang['lighbox_lastaction'] = "Lightbox last updated:";
$lang['delete_lightbox_confirm'] = "Do you really want to delete the lightbox?";
//-----------------------------------------------------
//--- Misc --------------------------------------------
//-----------------------------------------------------
$lang['new'] = "new"; // Marks categories and images as "NEW"
$lang['home'] = "Home";
$lang['categories'] = "Categories";
$lang['sub_categories'] = "Subcategories";
$lang['lightbox'] = "Lightbox";
Change it to:
//-----------------------------------------------------
//--- Lightbox ----------------------------------------
//-----------------------------------------------------
$lang['lightbox_no_images'] = "No images stored in your album.";
$lang['lightbox_add_success'] = "Image added.";
$lang['lightbox_add_error'] = "Error adding image!";
$lang['lightbox_remove_success'] = "Image deleted from album.";
$lang['lightbox_remove_error'] = "Error deleting image!";
$lang['lightbox_register'] = "In order to use the album, you have to register.<br />» <a href=\"{url_register}\">Register now</a>";
$lang['lightbox_delete_success'] = "Album deleted.";
$lang['lightbox_delete_error'] = "Error deleting album!";
$lang['delete_lightbox'] = "Delete album";
$lang['lighbox_lastaction'] = "Album last updated:";
$lang['delete_lightbox_confirm'] = "Do you really want to delete the album?";
//-----------------------------------------------------
//--- Misc --------------------------------------------
//-----------------------------------------------------
$lang['new'] = "new"; // Marks categories and images as "NEW"
$lang['home'] = "Home";
$lang['categories'] = "Categories";
$lang['sub_categories'] = "Subcategories";
$lang['lightbox'] = "My Album";
3_ FOOTER
Here, you've got 6 custom links.
You can create 6 own template pages and call them as shown above.
Each link to each "own_template.html" should so be:
<a href={url_home}?template=own_template">Own_template</a>
Particular case: you may prefer use the Contact Form MOD (http://www.4homepages.de/forum/index.php?topic=8987.0), instead of a custom html template page.
If so, you will create a "core" php file called "contact.php".
To link to this page, proceed like KurtW said.
Open the file includes/page_header.php and find:
"url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),
Insert after:
"url_contact" => $site_sess->url(ROOT_PATH."contact.php"),
In the template file "my_footer.html", you will call the contact page by this link:
<a href="{url_contact}">CONTACT US</a>
--> Optional: if you need to do a multilingual site, please do the modifications in your language file for links descriptions, as mentioned by KurtW.
Hope I was clear enough, and sorry again for this loss of time. It's also more difficult to explain clearly than to understand...
-
Thanks a lot for clarifying.
Still, I didn't understand the KurtW post about "therms" and loosing the session. Should I just ignore that or is there something of importance to understand about it?
By the way, I'm not going to use any contact forum, I'm going to use an ordinary e-mail address instead.
-
Hi;
there was a confusion with your "terms" and "therms". Forget about it. The fault is ours as we didn't explain clearly enough. As I said before, explaining is more difficult than understanding.
In fact, to resume, each time you create a "core" PHP file, like "contact.php" or "terms.php", you will have to declare it's session URL in "includes/page_header.php" like in my previous post, so you can use {url_contact} or {url_terms} in your templates, keeping the user's session alive.
If you create only custom HTML template files, like "FAQ.html", simply use links like {url_home}?template=FAQ.
To use an ordinary e-mail contact link, use this:
<a href="mailto:my_address@my_isp.com?subject=My Site Feedback">Contact Us</a>
Replace "my_address@my_isp.com" by your own email address.
Replace "My Site Feedback" by the subject you want to be displayed in the mails you will receive.
-
Hi,
one question? do you lose with this links the session?
I thing it is better looks like the link tags:
in includes/page_header.php
search:
"url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),
after add:
"url_therms" => $site_sess->url(ROOT_PATH."therms.php"),
search:
"charset" => $lang['charset'],
after add:
"lang_therms" => $lang['therms'],
add in lang/my_language/main.php:
$lang['therms'] = "Therms";
add in my_menue.html, where do you like the link:
<a href="{url_therms}">{lang_therms}</a>
And why do I have to add these things that KurtW added?
- You logged in with a seesion id and with this links you lost it.
- Multi language possible
KurtW
done as advised ... but stilll the session variables are lost .. as i move from the home to the already builtin pages ...eg from index.php to top.php or search.php the session variables r lost nd the user has to sign in again ..... but the session is still intact when i go to the new pages that i hv created ........ do u hv ne solution for this .. !! reply plsss