Author |
Message |
transit
Regular
![Regular Regular](modules/Forums/images/ranks/2stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Jun 01, 2010
Posts: 69
|
Posted:
Wed Jun 23, 2010 10:05 pm |
|
I have RN 2.40.1 installed.
I am trying to create an Admin to run my site for me however I do not want to make them a Super Admin and have them mess up some key things because they really don't know what they are doing!
I noticed that in the Admin panel it is split up into two tables
- Administration Menu
- Modules Administration
The problem is that there are 3 things I need him to have access to:
- Tricked Out Slider v. 1
- Messages
- Nuke SEO 1.0 BETA
Any help would be greatly appreciated!
I don't really care if I need to go into the DB to make changes to permissions or whether their is code fixes for the above. It only needs to be set up once anyways.
Thanks! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
Site Admin
![](modules/Forums/images/avatars/0c0adf824792d6d341ef4.gif)
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Sat Jun 26, 2010 8:23 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
transit
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jun 26, 2010 11:44 am |
|
Works like a charm!
Adding other ones is as simple as replacing im guessing:
MODADM_MESSAGES
with
MODADM_YOURNUKEMODNAMEHERE
and
'.php?op=messages'
with
'.php?op=nukemodnamehere'
Other than that I think the code should work regardless of the module? Am I correct? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Jun 27, 2010 3:22 pm |
|
It should, but I haven't really thought that statement through. Let me know if you find one that does not work and I'll try and help you out. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
transit
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Jun 27, 2010 6:01 pm |
|
Ok I got thru till admin/modules file on your guide there.
I am doing doing a conversion for nukeSEO v 1.0 beta.
this is the text within nukeSEO.php within the admin/modules/nukeSEO.php
Code:
$textrowcol = "rows='10' cols='50'";
if($Version_Num > "7.6") { $textrowcol = "rows='15' cols='75'"; }
$getAdmin = $db->sql_fetchrow($db->sql_query("SELECT * FROM `".$prefix."_authors` WHERE `aid`='$aid'"));
if ($getAdmin['radminsuper'] == 1) {
switch($op) {
|
What should I change it to?
I didn't want to dig in there and mess up all the syntax ![Razz](modules/Forums/images/smiles/icon_razz.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
Site Admin
![](modules/Forums/images/avatars/Dilbert/Dilbert_-_Dogbert_King.gif)
Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Sun Jun 27, 2010 6:41 pm |
|
transit wrote: | Ok I got thru till admin/modules file on your guide there.
I am doing doing a conversion for nukeSEO v 1.0 beta.
this is the text within nukeSEO.php within the admin/modules/nukeSEO.php
Code:
$textrowcol = "rows='10' cols='50'";
if($Version_Num > "7.6") { $textrowcol = "rows='15' cols='75'"; }
$getAdmin = $db->sql_fetchrow($db->sql_query("SELECT * FROM `".$prefix."_authors` WHERE `aid`='$aid'"));
if ($getAdmin['radminsuper'] == 1) {
switch($op) {
|
What should I change it to?
I didn't want to dig in there and mess up all the syntax |
Code:
$textrowcol = "rows='10' cols='50'";
if($Version_Num > "7.6") { $textrowcol = "rows='15' cols='75'"; }
$module_name = basename(substr(__FILE__, 0, -16));
$aid = substr($aid, 0,25);
$query = $db->sql_query('SELECT title, admins FROM ' . $prefix . '_modules WHERE title="' . $module_name . '"');
list($title, $admins) = $db->sql_fetchrow($query);
$db->sql_freeresult($query);
$query2 = $db->sql_query('SELECT aid, radminsuper FROM ' . $prefix . '_authors WHERE aid="' . $aid . '"');
list($aname, $radminsuper) = $db->sql_fetchrow($query2);
$db->sql_freeresult($query2);
$admins = explode(',', $admins);
$auth_user = 0;
for($i=0; $i < sizeof($admins); $i++) {
if($aname == $admins[$i] && !empty($admins)) {
$auth_user = 1;
}
}
if($radminsuper == 1 || $auth_user == 1) {
switch($op) {
|
This could probably be optimized a bit, but this is basically what you want. |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
transit
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Jun 28, 2010 12:40 pm |
|
I took the tutorial here:
http://montegomusings.com/index.php/technology/nuke/avoiding-the-admin-superuser-trap?blog=2
and pasted in my own code that I have changed thus far (with pablin's addition at the bottom of my post) The only thing I am wondering is if I have typed something below wrong... OR there are more files within admin/modules/nukeSEO/ that need to be edited (or are those for ShortLinks?!)
Heres the modified tutorial:
Open up the file:
Within the modules/nukeSEO/admin directory, place a file called case.php with the following code in it:
Code:
<?php
if (!defined('MODADM_NUKESEO')) define('MODADM_NUKESEO', 'nukeSEO');
?>
|
Also within this same directory, place a file called links.php with the following code in it:
Code:
<?php
if (!defined('ADMIN_FILE')) {
die('Access Denied');
}
global $admin_file;
adminmenu($admin_file.'.php?op=nukeSEO', _NUKESEO, 'nukeSEO.gif');
?>
|
Also within this same directory, place a file called index.php with the following code in it (yes, essentially a file with no PHP code between the tags):
Open up the file:
admin/case/case.nukeSEO.php
After this code here:
Code:
if (!defined('ADMIN_FILE')) {
die('Access Denied');
}
|
Add this line of code before the “switch” statement:
Code:
if (!defined('MODADM_NUKESEO')) define('MODADM_NUKESEO', 'nukeSEO');
|
Now, this is where the differences in code between RavenNuke(tm) and PHP-Nuke patched might be slightly different. Open the following file:
admin/modules/messages.php
Find this code here:
Code:
$textrowcol = "rows='10' cols='50'";
if($Version_Num > "7.6") { $textrowcol = "rows='15' cols='75'"; }
$getAdmin = $db->sql_fetchrow($db->sql_query("SELECT * FROM `".$prefix."_authors` WHERE `aid`='$aid'"));
if ($getAdmin['radminsuper'] == 1) {
switch($op) {
|
And simply replace it with this:
Code:
$textrowcol = "rows='10' cols='50'";
if($Version_Num > "7.6") { $textrowcol = "rows='15' cols='75'"; }
$module_name = basename(substr(__FILE__, 0, -16));
$aid = substr($aid, 0,25);
$query = $db->sql_query('SELECT title, admins FROM ' . $prefix . '_modules WHERE title="' . $module_name . '"');
list($title, $admins) = $db->sql_fetchrow($query);
$db->sql_freeresult($query);
$query2 = $db->sql_query('SELECT aid, radminsuper FROM ' . $prefix . '_authors WHERE aid="' . $aid . '"');
list($aname, $radminsuper) = $db->sql_fetchrow($query2);
$db->sql_freeresult($query2);
$admins = explode(',', $admins);
$auth_user = 0;
for($i=0; $i < sizeof($admins); $i++) {
if($aname == $admins[$i] && !empty($admins)) {
$auth_user = 1;
}
}
if($radminsuper == 1 || $auth_user == 1) {
switch($op) {
|
After all of this I see the module as "Inactive" within the Modules list, and then I add the Module nukeSEO to permissions for the admin. But when I log in and click the link within the admin panel for the admin that I set up it goes to a blank white page that says:
Access Denied
Any help would be greatly appreciated! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
transit
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Jul 05, 2010 9:57 pm |
|
Bump Any thoughts? Still havent figured this out. The above is the modified tutorial of montego to add in the same for nukeSEO. (The changes and files I created to show you what code I am trying to use for the change) But something must be wrong since I am getting an Access Denied and a _NUKESEO showing up in the admin panel since it is obviously not pulling properly from the lang file as well. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
Site Admin
![](modules/Forums/images/avatars/41f0b40a419280935f3a0.gif)
Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Wed Jul 21, 2010 7:49 am |
|
This will require some effort. I understand what you want to do, but it will take some time to review this in detail. |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/3234de284ee21bd39eecd.jpg)
Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina
|
Posted:
Wed Jul 21, 2010 9:42 am |
|
I'm not sure if this is a typo or not, but you said open and edit admin/modules/messages.php but you are wanting to edit admin/modules/nukeSEO.php |
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 21, 2010 10:35 am |
|
Try this code instead
Code:$textrowcol = "rows='10' cols='50'";
if($Version_Num > "7.6") { $textrowcol = "rows='15' cols='75'"; }
$row = $db->sql_fetchrow($db->sql_query('SELECT `title`, `admins` FROM `'.$prefix.'_modules` WHERE `title`=\''.MODADM_NUKESEO.'\''));
$row2 = $db->sql_fetchrow($db->sql_query('SELECT `name`, `radminsuper` FROM `'.$prefix.'_authors` WHERE `aid`=\''.$aid.'\''));
$admins = explode(',', $row['admins']);
$auth_user = 0;
for($i=0; $i < sizeof($admins); $i++) { if($row2['name'] == $admins[$i] AND $row['admins'] != '') { $auth_user = 1; } }
if($row2['radminsuper'] == 1 || $auth_user == 1) {
switch($op) {
|
also, your links.php should look like this
Code:<?php
if (!defined('ADMIN_FILE')) {
die('Access Denied');
}
global $admin_file;
adminmenu($admin_file.'.php?op=nukeSEO', nukeSEO, 'nukeSEO.jpg');
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
transit
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 22, 2010 8:29 am |
|
Genius nuken Works like a charm
One last kind of related question, say for basic admin functionality, would it be too hard and would all i have to do is create an admin folder for Docs 1.0 by nukecoder and make a links.php and a case.php and point it to the actual module since there is no ACP options for that module and rather just edit delete functions within it. My site just doesnt have left or right blocks nor the nukeNAV, so I wanted to create a quick link from the ACP for my lower level admins to the Docs module (no need to create ACP editing for such a simple module).
Thoughts? Or have I hopelessy babbled and lost all of you ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
Site Admin
![](modules/Forums/images/avatars/125904890252d880f79f312.png)
Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Fri Jul 23, 2010 3:23 pm |
|
You don't need to to do that. If they are logged in as an admin, they will see the administration links within the module itself. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
transit
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Jul 25, 2010 11:05 am |
|
Yeah but the module is not visable and the left and right blocks as well as nukeNAV are completely turned off, I just need a link in the ACP so that the direct link doesnt have to be typed in everytime. Help? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/48fb116845dfecf66294c.gif)
Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA
|
Posted:
Sun Jul 25, 2010 12:02 pm |
|
transit wrote: | Yeah but the module is not visable and the left and right blocks as well as nukeNAV are completely turned off, I just need a link in the ACP so that the direct link doesnt have to be typed in everytime. Help? |
I did up a quicky block for you. Save as block-Docs.php, upload, activate and set as center down and view = admin only, and they will have a list of all documents
Code:
<?php
if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
global $prefix, $db;
$content = '';
$sql = 'SELECT id, title FROM '.$prefix.'_docs';
$result = $db->sql_query($sql);
while (list($id, $title) = $db->sql_fetchrow($result)) {
$id = intval($id);
$title = check_html($title, 'nohtml');
$content .= '<strong><big>·</big></strong> <a style="white-space:nowrap;" href="modules.php?name=Docs&do=show_doc&id='.$id.'">'.$title.'</a> ';
}
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
transit
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Jul 26, 2010 12:41 am |
|
Perfect
The last thing to intergrate this all together is I need to have the words "Site Administration" pop up on the top of the theme header when logged into the admin panel only. Then just simply have it link to admin.php
I need to have it in the theme.php I guess because I need it on every page when logged in since I don't use blocks nor the nukenav and dont want to go back to the home screen each time when working on the site. Thoughts?
Thanks alot guys!
Below is my theme.php
Code:<?php
/************************************************************/
/* IMPORTANT NOTE FOR THEMES DEVELOPERS! */
/* */
/* When you start coding your theme, if you want to */
/* distribute it, please double check it to fit the HTML */
/* 4.01 Transitional Standard. You can use the W3 validator */
/* located at http://validator.w3.org */
/* If you don't know where to start with your theme, just */
/* start modifying this theme, it's validate and is cool ;) */
/************************************************************/
/************************************************************/
/* Theme Colors Definition */
/* */
/* Define colors for your web site. $bgcolor2 is generaly */
/* used for the tables border as you can see on OpenTable() */
/* function, $bgcolor1 is for the table background and the */
/* other two bgcolor variables follows the same criteria. */
/* $texcolor1 and 2 are for tables internal texts */
/************************************************************/
$bgcolor1 = "#FEFFE0";
$bgcolor2 = "#FEFFE0";
$bgcolor3 = "#FEFFE0";
$bgcolor4 = "#FEFFE0";
$textcolor1 = "#000000";
$textcolor2 = "#000000";
include("themes/Trott/tables.php");
/************************************************************/
/* Function themeheader() */
/* */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks */
/* function for left side with: blocks(left); */
/************************************************************/
function themeheader() {
global $user, $banners, $sitename, $slogan, $cookie, $prefix, $db;
cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}
echo "<body bgcolor=\"#FEFFE0\" text=\"#000000\" link=\"#00000\" vlink=\"#000000\" alink=\"#000000\">";
if ($banners == 1) {
include("banners.php");
}
$topics_list = "<select name=\"new_topic\" onChange='submit()'>\n";
$topics_list .= "<option value=\"\">All Topics</option>\n";
$toplist = $db->sql_query("select topicid, topictext from ".$prefix."_topics order by topictext");
while(list($topicid, $topics) = $db->sql_fetchrow($toplist)) {
if ($topicid==$topic) { $sel = "selected "; }
$topics_list .= "<option $sel value=\"$topicid\">$topics</option>\n";
$sel = "";
}
if ($username == "Anonymous") {
$theuser = " <a href=\"account-new_user.html\">Create an account";
} else {
$theuser = " Welcome $username!";
}
$public_msg = public_message();
$tmpl_file = "themes/Trott/header.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
blocks(left);
$tmpl_file = "themes/Trott/left_center.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themefooter() */
/* */
/* Control the footer for your site. You don't need to */
/* close BODY and HTML tags at the end. In some part call */
/* the function for right blocks with: blocks(right); */
/* Also, $index variable need to be global and is used to */
/* determine if the page your're viewing is the Homepage or */
/* and internal one. */
/************************************************************/
function themefooter() {
global $index, $foot1, $foot2, $foot3, $copyright, $totaltime;
if ($index == 1) {
$tmpl_file = "themes/Trott/center_right.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
blocks(right);
}
$footer_message = "$foot1<br>$foot2<br>$foot3<br>$copyright<br>$totaltime";
$tmpl_file = "themes/Trott/footer.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themeindex() */
/* */
/* This function format the stories on the Homepage */
/************************************************************/
function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
global $anonymous, $tipath;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
$t_image = "themes/$ThemeSel/images/topics/$topicimage";
} else {
$t_image = "$tipath$topicimage";
}
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
$content = "$thetext$notes\n";
} else {
if($informant != "") {
$content = "<a href=\"modules.php?name=Your_Account&op=userinfo&username=$informant\">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
}
$posted = ""._POSTEDBY." ";
$posted .= get_author($aid);
$posted .= " "._ON." $time $timezone ($counter "._READS.")";
$tmpl_file = "themes/Trott/story_home.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themearticle() */
/* */
/* This function format the stories on the story page, when */
/* you click on that "Read More..." link in the home */
/************************************************************/
function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
global $admin, $sid, $tipath;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
$t_image = "themes/$ThemeSel/images/topics/$topicimage";
} else {
$t_image = "$tipath$topicimage";
}
$posted = ""._POSTEDON." $datetime "._BY." ";
$posted .= get_author($aid);
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
$content = "$thetext$notes\n";
} else {
if($informant != "") {
$content = "<a href=\"modules.php?name=Your_Account&op=userinfo&username=$informant\">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
}
$tmpl_file = "themes/Trott/story_page.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themesidebox() */
/* */
/* Control look of your blocks. Just simple. */
/************************************************************/
function themesidebox($title, $content) {
$tmpl_file = "themes/Trott/blocks.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Jul 26, 2010 7:09 am |
|
could you post your themes/Trott/header.html file as well? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
transit
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Jul 26, 2010 10:43 am |
|
header.html
Code:
<div rel="favicon.ico" onselectstart="return false;" style="-moz-user-select: none;">
<TABLE WIDTH=766 BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center">
<TR><TD><IMG SRC="themes/Trott/images/top.jpg" WIDTH=766 HEIGHT=190 ALT=""></TD></TR>
<TR>
<TD WIDTH=766 HEIGHT=46 valign="top">
<TABLE WIDTH=766 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD><IMG SRC="themes/Trott/images/m.jpg" WIDTH=15 HEIGHT=46 ALT=""></TD>
<TD><a href="index.html"><IMG SRC="themes/Trott/images/m1.jpg" ALT="" WIDTH=92 HEIGHT=46 border="0"></a></TD>
<TD><a href="info-3.html"><IMG SRC="themes/Trott/images/m2.jpg" ALT="" WIDTH=91 HEIGHT=46 border="0"></a></TD>
<TD><a href="Destinations/list.php?cat_id=4"><IMG SRC="themes/Trott/images/m3.jpg" ALT="" WIDTH=91 HEIGHT=46 border="0"></a></TD>
<TD><a href="faq-1-Frequently+Asked+Questions.html"><IMG SRC="themes/Trott/images/m4.jpg" ALT="" WIDTH=91 HEIGHT=46 border="0"></a></TD>
<TD><a href="forms.html"><IMG SRC="themes/Trott/images/m5.jpg" ALT="" WIDTH=91 HEIGHT=46 border="0"></a></TD>
<TD><a href="contactus.html"><IMG SRC="themes/Trott/images/m6.jpg" ALT="" WIDTH=91 HEIGHT=46 border="0"></a></TD>
<TD><a href="info-28.html"><IMG SRC="themes/Trott/images/m7.jpg" ALT="" WIDTH=91 HEIGHT=46 border="0"></a></TD>
<TD><a href="links.html.html"><IMG SRC="themes/Trott/images/m8.jpg" ALT="" WIDTH=91 HEIGHT=46 border="0"></a></TD>
<TD><IMG SRC="themes/Trott/images/mm.jpg" WIDTH=22 HEIGHT=46 ALT=""></TD>
</TR>
</TABLE>
</TD>
</TR>
<TR><TD><IMG SRC="themes/Trott/images/top_line.jpg" WIDTH=766 HEIGHT=7 ALT=""></TD></TR>
<TR>
<TD WIDTH=762 HEIGHT=446 valign="top">
<TABLE WIDTH=762 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD background="themes/Trott/images/left.jpg" valign="top" WIDTH=17><img src="themes/Trott/images/spacer.gif" width="17" alt=""></TD>
<TD WIDTH=731 HEIGHT=446 valign="top" style="background:#FEFFE0 ">
<table width="731" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="188" valign="top"><img src="themes/Trott/images/spacer.gif" alt="" width="165" height="1">
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Jul 26, 2010 11:23 am |
|
OK, lets see if this works. I going to assume your admins won't need to visit the Contact Us link, so we'll replace that if they are logged in as admin. You will need to create a new image (themes/Trott/images/ADMIN.jpg) the same size as the Contact Us image (themes/Trott/images/m6.jpg)
just the themeheader function for your theme
Code:function themeheader() {
global $user, $banners, $sitename, $slogan, $cookie, $prefix, $db, $admin;
cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}
echo "<body bgcolor=\"#FEFFE0\" text=\"#000000\" link=\"#00000\" vlink=\"#000000\" alink=\"#000000\">";
if ($banners == 1) {
include("banners.php");
}
$topics_list = "<select name=\"new_topic\" onChange='submit()'>\n";
$topics_list .= "<option value=\"\">All Topics</option>\n";
$toplist = $db->sql_query("select topicid, topictext from ".$prefix."_topics order by topictext");
while(list($topicid, $topics) = $db->sql_fetchrow($toplist)) {
if ($topicid==$topic) { $sel = "selected "; }
$topics_list .= "<option $sel value=\"$topicid\">$topics</option>\n";
$sel = "";
}
if ($username == "Anonymous") {
$theuser = " <a href=\"account-new_user.html\">Create an account";
} else {
$theuser = " Welcome $username!";
}
if (is_admin($admin)) {
$specialLINK = '<a href="admin.php"><IMG SRC="themes/Trott/images/ADMIN.jpg" ALT="" WIDTH=91 HEIGHT=46 border="0"></a>';
} else {
$specialLINK = '<a href="contactus.html"><IMG SRC="themes/Trott/images/m6.jpg" ALT="" WIDTH=91 HEIGHT=46 border="0"></a>';
}
$public_msg = public_message();
$tmpl_file = "themes/Trott/header.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
blocks(left);
$tmpl_file = "themes/Trott/left_center.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
|
and in your header.html template, find
Code:<TD><a href="contactus.html"><IMG SRC="themes/Trott/images/m6.jpg" ALT="" WIDTH=91 HEIGHT=46 border="0"></a></TD>
|
replace with
Code:<TD>$specialLINK</TD>
|
hopefully that will work. Is this theme based on fisubice? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
transit
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 28, 2010 11:02 am |
|
Made a little modification to it here:
Code:
function themeheader() {
global $user, $banners, $sitename, $slogan, $cookie, $prefix, $db, $admin;
cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}
echo "<body bgcolor=\"#FEFFE0\" text=\"#000000\" link=\"#00000\" vlink=\"#000000\" alink=\"#000000\">";
if ($banners == 1) {
include("banners.php");
}
$topics_list = "<select name=\"new_topic\" onChange='submit()'>\n";
$topics_list .= "<option value=\"\">All Topics</option>\n";
$toplist = $db->sql_query("select topicid, topictext from ".$prefix."_topics order by topictext");
while(list($topicid, $topics) = $db->sql_fetchrow($toplist)) {
if ($topicid==$topic) { $sel = "selected "; }
$topics_list .= "<option $sel value=\"$topicid\">$topics</option>\n";
$sel = "";
}
if ($username == "Anonymous") {
$theuser = " <a href=\"account-new_user.html\">Create an account";
} else {
$theuser = " Welcome $username!";
}
if (is_admin($admin)) {
$specialLINK = '<td><a href="admin.php"><IMG SRC="themes/Trott/images/SiteAdmin.jpg" ALT="" border="0"></a>
<a href="Destinations/admin/login.php"><IMG SRC="themes/Trott/images/DestinationsAdmin.jpg" ALT="" border="0"></a></td>
<td><div align="right">Welcome $username! [ <a href="admin.php?op=logout">Logout</a> ]</div></td>';
} else {
$specialLINK = '<td><div align="right"><a href="admin.php">Login</a></div></td>';
}
$public_msg = public_message();
$tmpl_file = "themes/Trott/header.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
blocks(left);
$tmpl_file = "themes/Trott/left_center.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
|
Since I have two seperate scripts for an admin to log into. I also decided since I need a login button as well to simply put it at the very top of the theme in the right hand corner.
The one question I had was I don't think the value for the adminuser is $username so what is the correct value to put in my "specialLINK"? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 28, 2010 1:11 pm |
|
what you have there will display the admin logon link to everyone, is that what you intended? Not sure why you would need to welcome the admin by name..? I've never done that, or remember seeing it done, so can't really say how to accomplish... it's probably a bad idea security wise as well |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|