1 (edited by phaticon 2006-06-29 21:27)

Topic: moving moderator footer links to header

I searched for something like this on here and punres.org first, and didn't find anything. I hope this is in the right category also.

What I wanted to do is move the admin/moderator tool links from the footer, to the header or underneath it somewhere. Everytime I try to modify those links to the header I have some kind of error, so I end up putting everything back to normal. I'm not great with PHP, but I can modify and understand some of it. I think it's the fact that the links in the footer call the $footer_style to change the links on those specific pages. The code in question that I want added to the header is below. Any help would be great on this. Thanks in advance.

    if ($footer_style == 'viewforum' && $is_admmod)
        echo "\t\t\t".'<p id="modcontrols"><a href="moderate.php?fid='.$forum_id.'&p='.$p.'">'.$lang_common['Moderate forum'].'</a></p>'."\n";

    else if ($footer_style == 'viewtopic' && $is_admmod) {
        echo "\t\t\t".'<dl id="modcontrols"><dt><strong>'.$lang_topic['Mod controls'].'</strong></dt><dd><a href="moderate.php?fid='.$forum_id.'&tid='.$id.'&p='.$p.'">'.$lang_common['Delete posts'].'</a></dd>'."\n";

        echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&move_topics='.$id.'">'.$lang_common['Move topic'].'</a></dd>'."\n";

        if ($cur_topic['closed'] == '1')
            echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&open='.$id.'">'.$lang_common['Open topic'].'</a></dd>'."\n";

        else
            echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&close='.$id.'">'.$lang_common['Close topic'].'</a></dd>'."\n";

        if ($cur_topic['sticky'] == '1')
            echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&unstick='.$id.'">'.$lang_common['Unstick topic'].'</a></dd></dl>'."\n";

        else
            echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&stick='.$id.'">'.$lang_common['Stick topic'].'</a></dd></dl>'."\n";
    }
    echo "\t\t\t".'</div>'."\n";
} ?>

Re: moving moderator footer links to header

Hrmm, they've been moved up in 1.3 I believe...

Re: moving moderator footer links to header

elbekko wrote:

Hrmm, they've been moved up in 1.3 I believe...

They are under the last topic in viewforum.php and under the last post in viewtopic.php in 1.3

Re: moving moderator footer links to header

So is there nothing I can do besides wait for a newer version to come out?

Re: moving moderator footer links to header

phaticon wrote:

So is there nothing I can do besides wait for a newer version to come out?

Where did you put it and how did you go about doing so? What errors occured?

FYI You'll need to change the $forum_id and similar variables, and you'll need to change the checks for what page you're on.

It is quite doable with some modding to the code, although personally I don't see such a trivial change as worth the trouble.

Looking for a certain modification for your forum? Please take a look here before posting.

Re: moving moderator footer links to header

Well the error was from a wrong variable, so I took it out and put everything back to normal. I just want to take the admin/mod tools from the footer and add them to the header on the same pages the're already on. I know it will take some work and might seem pointless, but anything is worth the trouble as long as it makes it different than most forum designs. I'm a designer so I try to make things look functional as well. So what am I going to have to change then? I can modify it but I don't really know which variables to change. I guess i'll give it a try again and see what happens.

7

Re: moving moderator footer links to header

If you want an easy way to do it just add a new item to the template like so <!-- pun_modmenu -->. Now you just place all the stuff from the moderator menu after the line in footer.php which reads  // END SUBST - <pun_footer> and create a buffering and str_replace routine to replace <!-- pun_modmenu -->. You can place <!-- pun_modmenu --> anywhere you like in the template. As it it a xhtml comment you don't have to bother about replacing it for those pages where the moderator controls are not present.

The alternative is to just use css, specifically absolute positioning, which means you don't have to modify anything.