Page 1 of 3

[MODDB] Move "Go to Administration Panel"-link

Posted: Tue Sep 03, 2002 12:35 pm
by Balint
Hello everybody!

This MOD has been released in the MOD-Database. Please continue discussion here: http://www.phpbb.com/phpBB/viewtopic.php?t=77840

This is my first release, so have mercy! :)

Especially in large forums you have to scroll a lot, if you want to go to the Admin Panel. I want to introduce a MOD which places the "Go to Administration Panel" on the top of the page and provides a small icon.

I have noticed that when you are logged in as admin the image dissapears on some pages eg. at "Usergroups" or at the posting confirmation pages. Maybe somebody could help me to fix this small issue?

Regards,

Bálint

You can download the image icon_mini_admin.gif here (right-click and save)

Code: Select all

############################################################## 
## MOD Title: Move "Go to Administration Panel"-link
## MOD Author: Balint < balint@krizsan.de > (Balint Krizsan) http://www.krizsan.de 
## MOD Description: Places "Go to Administration Panel" on top of the page.
##		    Only visible for admins.
##		    Tested with phpBB 2.0.1 and 2.0.2
## MOD Version: 1.0.0 
## 
## Installation Level: easy
## Installation Time: 10 Minutes 
## Files To Edit: includes/page_header.php,
##	 	  includes/page_tail.php,
##		  templates/subSilver/overall_footer.tpl,
##		  templates/subSilver/overall_header.tpl,
##		  templates/subSilver/subSilver.cfg  
## Included Files: icon_mini_admin.gif 
############################################################## 
## This MOD is released under the GPL License. 
## Intellectual Property is retained by the MOD Author(s) listed above 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ 
############################################################## 
## Author Notes: 
## THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY 
## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 
## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
## FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL 
## THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
## INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
## ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
##
## Revision History: 2002-08-06 - Version 1.0.0
##			- Initial Release
##
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ COPY IMAGES ]------------------------------------------ 
# 

copy icon_mini_admin.gif to templates/subSilver/images/icon_mini_admin.gif


# 
#-----[ OPEN FILE ]------------------------------------------ 
#
includes/page_header.php


# 
#-----[ FIND ]------------------------------------------ 
#
//
// Parse and show the overall header.
//


# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a class="mainmenu" href="' . append_sid("admin/index.$phpEx") . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';
$admin_img = ( $userdata['user_level'] == ADMIN ) ? '<img src="' . $images['control_panel'] . '" border="0" hspace="3" />' : '';

# 
#-----[ FIND ]------------------------------------------ 
#
'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new, 


# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
'ADMIN_LINK' => $admin_link,
'ADMIN_IMG' => $admin_img,


# 
#-----[ OPEN FILE ]------------------------------------------ 
#
includes/page_tail.php


# 
#-----[ FIND ]------------------------------------------ 
#
//
// Show the overall footer.
//
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . append_sid("admin/index.$phpEx") . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';


# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
//
// Show the overall footer.
//


# 
#-----[ FIND ]------------------------------------------ 
#
$template->assign_vars(array(
	'PHPBB_VERSION' => '2' . $board_config['version'],
	'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '', 
	'ADMIN_LINK' => $admin_link)
);


# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
$template->assign_vars(array(
	'PHPBB_VERSION' => '2' . $board_config['version'],
	'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '')
);


# 
#-----[ OPEN FILE ]------------------------------------------ 
# 
templates/subSilver/overall_header.tpl


# 
#-----[ FIND ]------------------------------------------ 
#
	<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>


# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
<tr>
	<td align="center">{ADMIN_IMG}<b>{ADMIN_LINK}</b></td>
</tr>



# 
#-----[ OPEN FILE ]------------------------------------------ 
# 
templates/subSilver/overall_footer.tpl


# 
#-----[ FIND ]------------------------------------------ 
# 
<div align="center"><span class="copyright"><br />{ADMIN_LINK}<br />


# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
<div align="center"><span class="copyright">


# 
#-----[ OPEN FILE ]------------------------------------------ 
# 
templates/subSilver/subSilver.cfg


# 
#-----[ FIND ]------------------------------------------ 
# 
$images['voting_graphic'][4] = "$current_template_images/voting_bar.gif";


# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
$images['control_panel'] = "$current_template_images/icon_mini_admin.gif";


# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM

Posted: Tue Sep 03, 2002 3:41 pm
by nexialys
you got it Balint... everything is ok... :):)

/me have a similar hack for the same option... :):)

Posted: Tue Sep 03, 2002 9:27 pm
by adam s
does this REPLACE the link at the bottom? or does it add another link at the top? I'd prefer both links, not a replacement.

Posted: Tue Sep 03, 2002 9:31 pm
by Drummer4Life05
Great MOD. Very simple, yet needed! :D

add another link...

Posted: Tue Sep 03, 2002 11:50 pm
by Balint
Hi!

@adam s: you have to do the following...

Code: Select all

############################################################## 
## MOD Title: Copy "Go to Administration Panel"-link
## MOD Author: Balint < balint@krizsan.de > (Balint Krizsan) http://www.krizsan.de 
## MOD Description: Places a copy of "Go to Administration Panel" on top of the page.
##		    Only visible for admins.
##		    Tested with phpBB 2.0.1 and 2.0.2
## MOD Version: 1.0.0 
## 
## Installation Level: easy
## Installation Time: 5 Minutes 
## Files To Edit: includes/page_header.php,
##		  templates/subSilver/overall_header.tpl,
##		  templates/subSilver/subSilver.cfg  
## Included Files: icon_mini_admin.gif 
############################################################## 
## This MOD is released under the GPL License. 
## Intellectual Property is retained by the MOD Author(s) listed above 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ 
############################################################## 
## Author Notes: 
## THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY 
## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 
## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
## FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL 
## THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
## INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
## ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
##
## Revision History: 2002-09-04 - Version 1.0.0
##			- Initial Release
##
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ COPY IMAGES ]------------------------------------------ 
# 

copy icon_mini_admin.gif to templates/subSilver/images/icon_mini_admin.gif


# 
#-----[ OPEN FILE ]------------------------------------------ 
#
includes/page_header.php


# 
#-----[ FIND ]------------------------------------------ 
#
//
// Parse and show the overall header.
//


# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a class="mainmenu" href="' . append_sid("admin/index.$phpEx") . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';
$admin_img = ( $userdata['user_level'] == ADMIN ) ? '<img src="' . $images['control_panel'] . '" border="0" hspace="3" />' : '';

# 
#-----[ FIND ]------------------------------------------ 
#
'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new, 


# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
'ADMIN_LINK' => $admin_link,
'ADMIN_IMG' => $admin_img,


# 
#-----[ OPEN FILE ]------------------------------------------ 
# 
templates/subSilver/overall_header.tpl


# 
#-----[ FIND ]------------------------------------------ 
#
	<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>


# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
<tr>
	<td align="center">{ADMIN_IMG}<b>{ADMIN_LINK}</b></td>
</tr>


# 
#-----[ OPEN FILE ]------------------------------------------ 
# 
templates/subSilver/subSilver.cfg


# 
#-----[ FIND ]------------------------------------------ 
# 
$images['voting_graphic'][4] = "$current_template_images/voting_bar.gif";


# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
$images['control_panel'] = "$current_template_images/icon_mini_admin.gif";


# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
In other words: simply do not follow the instructions for the includes/page_tail.php and templates/subSilver/overall_footer.tpl files.

Hey, this is my second MOD! :)

Balint

Posted: Fri Sep 06, 2002 1:09 am
by surtin3xposed
i don't know if you've been able to replace that missing picture part of the mod, but neither have i :lol: have u tried anything that has worked?

hm...

Posted: Sat Sep 07, 2002 8:08 pm
by Balint
Hello!

I tried to replace the image with a text message and this worked for me. So I think the image routine is wrong in some way... I posted the MOD in this forum to get some support from the gurus :wink: and I hope that somebody can help me!


Bálint

Posted: Mon Sep 09, 2002 5:38 am
by JetJam
Hey look, I did it and it works. :D
Balint, I would like to use your image with credit to you of course.
this being my first mod also, when I looked at your code it didn't make any sence to me, so I thought of what the mod was for, and it just came to me about 30min or so later, I have done a few mods on my board and the code gets easier to understand the more I do. so try it and tell me what you think. this only adds the pic and link to the header, next to logout pic and link.

Image

Code: Select all

############################################################## 
## MOD Title: Admin Panel Link for Header
## MOD Author: JetJam < jetjam@cyberdorre.com > (Jim) http://www.cyberdorre.com 
## MOD Description: Adds a link to the adminastration panel in the header, only when the admin is logged in.
## MOD Version: 1.0.0 
## 
## Installation Level: Easy 
## Installation Time: 3 Minutes 
## Files To Edit: page_header.php, overall_header.tpl
## Included Files: icon_mini_admin.gif (credit to Balint(Balint Krizsan) for image)
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ 
############################################################## 
## Author Notes: Enjoy, This Version is Tested with phpBB 2.0.1 and phpBB 2.0.2
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]------------------------------------------ 
#
includes/page_header.php
# 
#-----[ FIND ]------------------------------------------ 
# 
//
// Parse and show the overall header.
//
$template->set_filenames(array(
	'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//
// admin panel link mod
//
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . append_sid("admin/index.$phpEx") . '"><img src="templates/subSilver/images/icon_mini_admin.gif" width="12" height="13" border="0" alt="Admin Panel" hspace="3" />Admin Panel</a>&nbsp' : '';
//
// admin panel link mod
//
# 
#-----[ FIND ]------------------------------------------ 
# 
$template->assign_vars(array(
	'SITENAME' => $board_config['sitename'], 
	'SITE_DESCRIPTION' => $board_config['site_desc'], 
	'PAGE_TITLE' => $page_title,
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
	'ADMIN_LINK' => $admin_link,
# 
#-----[ OPEN ]------------------------------------------ 
#
templates\subSilver\overall_header.tpl
# 
#-----[ FIND ]------------------------------------------ 
#
alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a>&nbsp;</span></td>
# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a>&nbsp; &nbsp;{ADMIN_LINK}&nbsp;</span></td>
# 
#-----[ COPY ]------------------------------------------ 
#
icon_mini_admin.gif to templates/subSilver/images/
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
ENJOY... 8)
JetJam

ehm...

Posted: Thu Sep 12, 2002 8:44 pm
by Balint
Hello!

@JetJam: I am sorry but I can not accept this method of "taking" my code to make a new MOD. The good way is to make suggestions and get credit for them. I'll release 1.0.1 and give you the credit but please do not make anything like this one anymore.

I thought a lot about what to answer, please respect my decision.

Bálint

Re: ehm...

Posted: Thu Sep 12, 2002 10:52 pm
by JetJam
Balint wrote: Hello!

@JetJam: I am sorry but I can not accept this method of "taking" my code to make a new MOD. The good way is to make suggestions and get credit for them. I'll release 1.0.1 and give you the credit but please do not make anything like this one anymore.

I thought a lot about what to answer, please respect my decision.

Bálint


I don't have a problem with your decision and sorry if I offended you. :(

but this was just a suggestion and it is a "idea" with all new code put in different places, as you can see in the pics there is one problem with how to get rid of the underline when not moused over.

my fault, I was just proud of my self to have done this with new and little changes to the orginal phpBB code.

Posted: Fri Sep 13, 2002 1:16 am
by adam s
JetJam, i like the way your looks much better, and it works better too.

also, i don't have that problem with the link being underlined, not sure why yours is?

Posted: Fri Sep 13, 2002 3:48 am
by JetJam
Thanks adam s, I am glade you like it
I figured out why mine showed an underline, it was a setting in IE options :wink:

Posted: Fri Sep 13, 2002 4:22 am
by adam s
what is EI?

Posted: Fri Sep 13, 2002 5:13 am
by JetJam
No not IE, I can get ride of it with the setting in IE(underline links=hover) but thats not the right way to do it. I was missing the(class="mainmenu") code and now its right.
this

Code: Select all

// 
// admin panel link mod 
// 
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . append_sid("admin/index.$phpEx") . '"><img src="templates/subSilver/images/icon_mini_admin.gif" width="12" height="13" border="0" alt="Admin Panel" hspace="3" />Admin Panel</a>&nbsp' : ''; 
// 
// admin panel link mod 
//
change to

Code: Select all

//
// admin panel link mod
//
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . append_sid("admin/index.$phpEx") . '" 

class="mainmenu"><img src="templates/subSilver/images/icon_mini_admin.gif" width="12" height="13" border="0" alt="Admin 

Panel" hspace="3" />Admin Panel</a>&nbsp' : '';
//
// admin panel link mod
//
ENJOY :wink:

Posted: Fri Sep 13, 2002 5:25 am
by adam s
make sure to fix it in your post above then ;)