PDA

View Full Version : Can anyone help me with this code


diveram
08-16-2003, 10:13 PM
I have a forum running phpbb, it works great. I added a few features to it today. The problem I have is the main menu is not linening up right when one logs in. I also had a homepage link there, but I removed it.

My goal is to clean it up, so its centered, and have a homepage link with an image (which I have)

You can view it here http://www.learntoscuba.net/phpbb2

when you log in it gets funky. log in as "test" password is "test"

Here is the code that effects the menu.

<tr>
<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;<a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a></span><span class="mainmenu">&nbsp; &nbsp;<a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a> &nbsp;<a &nbsp; &nbsp;<a href="{U_MEMBERLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a>&nbsp; &nbsp;<a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>&nbsp;
<!-- BEGIN switch_user_logged_out -->
&nbsp;<a href="{U_REGISTER}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_register.gif" width="12" height="13" border="0" alt="{L_REGISTER}" hspace="3" />{L_REGISTER}</a></span>&nbsp;
<!-- END switch_user_logged_out -->
</td>
</tr>
<tr>
<td height="25" align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;<a href="{U_PROFILE}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" hspace="3" />{L_PROFILE}</a>&nbsp; &nbsp;<!-- BEGIN switch_user_logged_in -->
<a href="{U_BUDDYLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_buddylist.gif" width="12" height="13" border="0" alt="{L_BUDDYLIST}" hspace="3" />{L_BUDDYLIST}</a>&nbsp; &nbsp;
<!-- END switch_user_logged_in -->
<a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a>&nbsp; &nbsp;<a href="{U_LOGIN_LOGOUT}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a>&nbsp;</span></td>
</tr>
</table></td>
</tr>
</table>

<br />

Mntsnow
08-16-2003, 11:27 PM
So are you wanting the divers helmet centered in the page?

diveram
08-17-2003, 7:47 AM
No not the helmet. I took out the extra code. it now looks like this. (see below)

If you check out the site, the faq, search, memberlist, ect - is nice and neat. If I add the code they tell me it's all messed up. I can put it back in if you like.

I also want to add a homepage link in linr with the rest.

<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;<a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a></span><span class="mainmenu">&nbsp; &nbsp;<a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a>&nbsp; &nbsp;<a href="{U_MEMBERLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a>&nbsp; &nbsp;<a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>&nbsp;
<!-- BEGIN switch_user_logged_out -->
&nbsp;<a href="{U_REGISTER}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_register.gif" width="12" height="13" border="0" alt="{L_REGISTER}" hspace="3" />{L_REGISTER}</a></span>&nbsp;
<!-- END switch_user_logged_out -->
</td>
</tr>
<tr>
<td height="25" align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;<a href="{U_PROFILE}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" hspace="3" />{L_PROFILE}</a>&nbsp; &nbsp; <a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a>&nbsp; &nbsp;<a href="{U_LOGIN_LOGOUT}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a>&nbsp;</span></td>
</tr>
</table></td>
</tr>
</table>

<br />

The code they want me to add is this:
<!-- BEGIN switch_user_logged_in -->
<a href="{U_BUDDYLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_buddylist.gif" width="12" height="13" border="0" alt="{L_BUDDYLIST}" hspace="3" />{L_BUDDYLIST}</a>&nbsp; &nbsp;
<!-- END switch_user_logged_in -->

Thank Mntsnow!

Mntsnow
08-17-2003, 10:38 AM
Try this Brian and let me know if that was more of what you were shooting for

<td align="center" valign="top" nowrap="nowrap">
<p align="center"><span class="mainmenu"> <a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a> <a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a> <a href="{U_MEMBERLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a> <a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>
<!-- BEGIN switch_user_logged_out -->
<a href="{U_REGISTER}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_register.gif" width="12" height="13" border="0" alt="{L_REGISTER}" hspace="3" />{L_REGISTER}</a></span>
<!-- END switch_user_logged_out -->
</td>
</tr>
<tr>
<td height="25" align="center" valign="top" nowrap="nowrap"><span class="mainmenu"> <a href="{U_PROFILE}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" hspace="3" />{L_PROFILE}</a> <a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a> <a href="{U_LOGIN_LOGOUT}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a> </span></td>
</tr>
</table></td>
</tr>
</table>

<br />

The code they want me to add is this:
<!-- BEGIN switch_user_logged_in -->
<a href="{U_BUDDYLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_buddylist.gif" width="12" height="13" border="0" alt="{L_BUDDYLIST}" hspace="3" />{L_BUDDYLIST}</a></p>
<!-- END switch_user_logged_in -->

diveram
08-17-2003, 2:44 PM
Ok, I addes the code as per instructions. Its a buddylist link.

Mntsnow, log in and see what happens. I loose the profile link, and its all messed up. Thats what I want to fix.

diveram
08-17-2003, 3:03 PM
Never Mnd..I got it!!! It was just some stupid spacing in the lines of code. Thanks Mike!

diveram
08-17-2003, 3:12 PM
Now I want to add a link to the main site.

I want an image in front of it like all the others. I have the small house icon already.

This is what I think I need

href="thhp://www.eastbaydivecenter.com" class="mainmenu"> Homepage</a>&nbsp;

How do I place an image there? And where do I place it in the code if I want to be before the FAQ link?

Mntsnow
08-17-2003, 4:15 PM
glad you got it handled.

Crouse
08-18-2003, 12:45 AM
First thing I would do is clean up the code....just so it's simpler to read..... doesn't take any more time for the webserver to serve it anyway.....plus it makes it much easier on the human eyes....


<td align="center" valign="top" nowrap="nowrap">
<span class="mainmenu">
<a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a>
</span>

<span class="mainmenu">
<a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a>

<a href="{U_MEMBERLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a>

<a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>


<!-- BEGIN switch_user_logged_out -->
<a href="{U_REGISTER}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_register.gif" width="12" height="13" border="0" alt="{L_REGISTER}" hspace="3" />{L_REGISTER}</a>
</span>
<!-- END switch_user_logged_out -->
</td>


Now simply add the link ....... including the url of the page you want to go to, and the image you want to show up.......


<td align="center" valign="top" nowrap="nowrap">
<span class="mainmenu">

<a href="WHATEVERYOURURLIS.com"><img src="WHATEVERTHEIMAGEURLIS.gif"></a>

<a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a>
</span>

<span class="mainmenu">
<a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a>

<a href="{U_MEMBERLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a>

<a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>


<!-- BEGIN switch_user_logged_out -->
<a href="{U_REGISTER}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_register.gif" width="12" height="13" border="0" alt="{L_REGISTER}" hspace="3" />{L_REGISTER}</a>
</span>
<!-- END switch_user_logged_out -->
</td>


That should do it.......... if you don't want to work with the ../images/ whatever directory path... you can actually put in the FULL url to the image instead of just the path.... IE stick in a folder in the root directory called "myimages" ..... the FULL url being http://www.eastbaydivecenter.com/myimages/HOUSEICON.gif

HTH's

diveram
08-18-2003, 7:49 PM
Thank you Crouse, thats much cleaner than what I have.

Crouse
08-19-2003, 12:20 AM
Your welcome. Hope that's what you were after.

One of the other tricks that I use when working with code by hand is to remember that browsers don't care about WHITE space. When adding mods to phpBB2 I always leave ALOT of space between my mod and the normal code. Makes it much easier to find later on....... plus I comment the crap out of it, cause my memory sucks sometimes :D :D 6 months down the road, it's nice to be reminded by those comments ...what exactley I was doing. And 6 months down the road it's easy to find the section of a large piece of html code i modified. I just scroll down till i hit a blank section....right after that is my modified code ;)