4images Forum & Community

4images Modifications / Modifikationen => Templates & Styles (Requests & Discussions) => Topic started by: nicky9 on May 06, 2008, 10:23:58 AM

Title: Menu?
Post 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.
Title: Re: Menu?
Post by: † manurom on May 06, 2008, 12:33:10 PM
Hello;
it should be possible, extending your template.

Here is an example, using the default template.

At the end of this file, just before the closing:
Code: [Select]
?>
add these lines:
Code: [Select]
//---------------------------------------------------------------------------------------------
//---- 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); 



_____Create a first file called "my_menu.html", with this example code:
Code: [Select]
<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:
Code: [Select]
<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>


Example: open your_template/home.html file/
Find:
Code: [Select]
{endif random_image}
Add this:
Code: [Select]
{my_menu}
Find:
Code: [Select]
{footer}
Add BEFORE:
Code: [Select]
{my_footer}
I've done this with the default menu, as I said, and had this:


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.
Title: Re: Menu?
Post by: nicky9 on May 06, 2008, 01:18:45 PM
Thanx a bunch ! !  :D

I'll try it out.
Title: Re: Menu?
Post by: mawenzi on May 06, 2008, 02:46:14 PM
... perfect manurom ...  :D
... this should be a tutorial ... in the right forum ... !
Title: Re: Menu?
Post by: nicky9 on May 06, 2008, 03:59:40 PM
Perhaps somebody with the right energy should put together all the essentials in a manual?  :P
Title: Re: Menu?
Post by: † manurom on May 06, 2008, 04:39:52 PM
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.
Title: Re: Menu?
Post by: KurtW on May 06, 2008, 05:31:47 PM
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:
Code: [Select]
  "url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),after add:
Code: [Select]
  "url_therms" => $site_sess->url(ROOT_PATH."therms.php"),search:
Code: [Select]
  "charset" => $lang['charset'],after add:
Code: [Select]
  "lang_therms" => $lang['therms'],

add in lang/my_language/main.php:
Code: [Select]
$lang['therms'] = "Therms";
add in my_menue.html, where do you like the link:
Code: [Select]
<a href="{url_therms}">{lang_therms}</a>

Quote
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

Title: Re: Menu?
Post by: † manurom on May 06, 2008, 06:01:17 PM
Hi, Kurtw;
my bad! :oops:
Did answer too much too quickly, but not checked enough.
You're totally right.
Title: Re: Menu?
Post by: nicky9 on May 06, 2008, 09:06:24 PM
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?
Title: Re: Menu?
Post by: KurtW on May 07, 2008, 05:55:34 AM
Hi,

please look at my last post...

KurtW
Title: Re: Menu?
Post by: nicky9 on May 07, 2008, 11:11:35 AM
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:

Title: Re: Menu?
Post by: nicky9 on May 07, 2008, 12:29:13 PM
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?
Title: Re: Menu?
Post by: † manurom on May 07, 2008, 02:08:08 PM
Have you got existing pages for terms of use, contact form, or any other stuff?
Title: Re: Menu?
Post by: nicky9 on May 07, 2008, 03:10:24 PM
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?
Title: Re: Menu?
Post by: † manurom on May 07, 2008, 04:04:07 PM
Hello;

_____Or else, let your visitor use its emailing software, using a link like this in your menu or footer:
Code: [Select]
<a href="mailto:me@myhost.com">Contact us</a>

_____For links to external sites, like partners, you may use this in your menu or footer:
Code: [Select]
<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.
Title: Re: Menu?
Post by: nicky9 on May 08, 2008, 12:49:22 PM
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?
Title: Re: Menu?
Post by: nicky9 on May 09, 2008, 04:46:19 PM
So how do to?  :P
Title: Re: Menu?
Post by: † manurom on May 10, 2008, 10:05:32 AM
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:
Code: [Select]
<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:
Code: [Select]
//-----------------------------------------------------
//--- 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 />&raquo; <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:
Code: [Select]
//-----------------------------------------------------
//--- 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 />&raquo; <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:
Code: [Select]
<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:
Code: [Select]
  "url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),Insert after:
Code: [Select]
  "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:
Code: [Select]
<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...
Title: Re: Menu?
Post by: nicky9 on May 10, 2008, 10:59:05 AM
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.
Title: Re: Menu?
Post by: † manurom on May 10, 2008, 11:15:50 AM
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:
Code: [Select]
<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.
Title: Re: Menu?
Post by: tanirtheone on July 10, 2009, 03:07:56 PM
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:
Code: [Select]
  "url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),after add:
Code: [Select]
  "url_therms" => $site_sess->url(ROOT_PATH."therms.php"),search:
Code: [Select]
  "charset" => $lang['charset'],after add:
Code: [Select]
  "lang_therms" => $lang['therms'],

add in lang/my_language/main.php:
Code: [Select]
$lang['therms'] = "Therms";
add in my_menue.html, where do you like the link:
Code: [Select]
<a href="{url_therms}">{lang_therms}</a>

Quote
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