Welcome, Guest. Please Login or Register.
September 16, 2021, 05:22:13 AM
Home Help Search Login Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Completed mods  |  Topic: [Done 1.5.1] Global Moderator center. « previous next »
Pages: 1 2 [3] 4 5 ... 24 Reply Ignore Print
Author Topic: [Done 1.5.1] Global Moderator center.  (Read 111587 times)
Ironman
Guest
Re:[Done] Global Moderator center.
« Reply #30 on: May 04, 2002, 04:28:57 PM »
Reply with quote

I just can't await it.
Can't you give me the instructions just for that Template edit?  :)

« Last Edit: May 04, 2002, 05:28:23 PM by Ironman » Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.


WWW
Re:[Done] Global Moderator center.
« Reply #31 on: May 04, 2002, 04:35:07 PM »
Reply with quote

All you do is edit Gmod.php and add a link to the template editing function, then open up index.php find the part where it tells what to include when editing the template and check settings[7] to see if the person trying to edit it is an global moderator or a administrator, if they are an admin the inlclude admin.php if they are a global moderator include gmod.php.(warning though, this doesn't add options in the admin center to turn off access to editing the template.) If you open up my mod, you can see the exact things I did and just use them as an example in making it do this.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Ironman
Guest
Re:[Done] Global Moderator center.
« Reply #32 on: May 04, 2002, 04:52:40 PM »
Reply with quote

Huh, slowly...

My english is as well as your german...  ;)

I'll try my Best and report -the same procedure as last year ;D- here, when ready and works.  8)
Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.


WWW
Re:[Done] Global Moderator center.
« Reply #33 on: May 04, 2002, 05:01:26 PM »
Reply with quote

I only know a few words in German... I tried to learn a little bit since I am half German and half Jew...

But anyway, open Gmod.php and add this wherever you want the link to edit the template to be:

Code: [Select]
<a href="$cgi;action=modtemp">$txt[216]</a><br>
Then you need to add these functions to the bottom of Gmod.php but right before the ?>

Code: [Select]
function ModifyTemplate (){
global $yytitle,$boarddir,$txt,$imagesdir,$color,$cgi,$db_prefix;

/*** Added Dave by Smulders - .html & .php template support ***/
$templateFile = "$boarddir/template.php";
if (!file_exists($templateFile))
$templateFile = "$boarddir/template.html";

 /*** Matt Siegman's Admin Fix ***/
$file = fopen($templateFile,"r");
$fulltemplate = fread($file,filesize($templateFile));
$fulltemplate = eregi_replace("</textarea>","&lt;/textarea&gt;",$fulltemplate);  //fix by Omar Bazavilvazo
fclose($file);
/*** Matt Siegman's Admin Fix ***/
$yytitle = $txt[216];
template_header();
print <<<EOT
<form action="$cgi;action=modtemp2" method="POST">
<table border="0" width="100%" cellspacing="1" bgcolor="$color[bordercolor]" class="bordercolor" cellpadding="4">
  <tr>
    <td class="titlebg" bgcolor="$color[titlebg]">
    <script language="javascript" TYPE="text/javascript">
<!--
function reqWin(desktopURL){
        desktop =window.open(desktopURL,"name","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=400,height=200,resizable=no");
        }
// -->
</script>
    <a href="javascript:reqWin('help.php?help=9')" class="help"><img src="$imagesdir/helptopics.gif" border="0" alt="$txt[119]"></a>
    <font size="2" class="text1" color="$color[titletext]"><b>$txt[216]</b></font></td>
  </tr><tr>
    <td class="windowbg" bgcolor="$color[windowbg]">
    <BR><font size="1">$txt[682]</font><BR><BR></td>
  </tr><tr>
    <td class="windowbg2" bgcolor="$color[windowbg2]" align="center"><font size="2">
    <form action="$cgi;action=modtemp2" method="POST"><BR>
    <textarea rows="30" cols="95" name="template" style="width:98%">$fulltemplate</textarea>
    <br><BR><input type="submit" value="$txt[10]"></font></td>
  </tr>
</table>
</form>
EOT;
footer();
obExit();
}

function ModifyTemplate2 (){
global $template,$boarddir,$yySetLocation,$cgi,$db_prefix;
$template = stripslashes($template);

 /*** Added by Dave Smulders - .html & .php template support ***/
$templateFile = "$boarddir/template.php";
if (!file_exists($templateFile))
$templateFile = "$boarddir/template.html";

$fh = fopen($templateFile,'w');
fputs ($fh,$template);
fclose($fh);
 /*** End Added by Dave Smulders ***/
$yySetLocation = "$cgi;action=gmod";
redirectexit();
}

Tell me when your finished with this, then I will tell you what to do next.
« Last Edit: May 04, 2002, 05:11:55 PM by AGISCI » Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Ironman
Guest
Re:[Done] Global Moderator center.
« Reply #34 on: May 04, 2002, 05:21:20 PM »
Reply with quote

Done. And now?
Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.


WWW
Re:[Done] Global Moderator center.
« Reply #35 on: May 04, 2002, 05:31:14 PM »
Reply with quote

Open index.php and look for:

Code: [Select]
      else if ($action == 'modtemp') { include_once ("$sourcedir/Admin.php"); ModifyTemplate(); }
      else if ($action == 'modtemp2') { include_once ("$sourcedir/Admin.php"); ModifyTemplate2(); }


And replace it with:

Code: [Select]
else if ($action == 'modtemp') {
global $settings,$txt,$gmodnews,$gmodcensor,$gmodreserve,$gmodban;
 if($settings[7] == 'Global Moderator') {
   include_once "$sourcedir/Gmod.php";
 }
 if($settings[7] == 'Administrator') {   
   include_once "$sourcedir/Admin.php";
 }
 ModifyTemplate();
}
else if ($action == 'modtemp2') {
global $settings,$txt,$gmodnews,$gmodcensor,$gmodreserve,$gmodban;
 if($settings[7] == 'Global Moderator') {
   include_once "$sourcedir/Gmod.php";
 }
 if($settings[7] == 'Administrator') {   
   include_once "$sourcedir/Admin.php";
 }
 ModifyTemplate2();
}


This is all you need to do to get it to work, if you want to add admin options to enable and disable it that will take some more code.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Ironman
Guest
Re:[Done] Global Moderator center.
« Reply #36 on: May 04, 2002, 05:37:46 PM »
Reply with quote

Thank you so much, I think this will work.  ;)
Is it much more code to add admin options to enable and disable?
Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.


WWW
Re:[Done] Global Moderator center.
« Reply #37 on: May 04, 2002, 05:47:32 PM »
Reply with quote

Not too much more code, but you would have to edit the mySQL settings tables.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Ironman
Guest
Re:[Done] Global Moderator center.
« Reply #38 on: May 04, 2002, 05:59:12 PM »
Reply with quote

This is not a big Problem for me I think, if I know what I've to change...  ;)
Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.


WWW
Re:[Done] Global Moderator center.
« Reply #39 on: May 04, 2002, 06:01:15 PM »
Reply with quote

Alright well first off open myphpadmin, then open the settings prefix, then add 'gmodtemplate' to it and set it to 1.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Ironman
Guest
Re:[Done] Global Moderator center.
« Reply #40 on: May 04, 2002, 06:13:09 PM »
Reply with quote

settings prefix? is this yabbse_settings? Could you give me a sql query for this?
« Last Edit: May 04, 2002, 06:14:47 PM by Ironman » Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.


WWW
Re:[Done] Global Moderator center.
« Reply #41 on: May 04, 2002, 06:16:56 PM »
Reply with quote

Yes the yabbse_settings

You need to create 'gmodtemplate' and make sure it has a setting of '1' which means that the global moderator can edit the template.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Ironman
Guest
Re:[Done] Global Moderator center.
« Reply #42 on: May 04, 2002, 06:20:45 PM »
Reply with quote

ALTER TABLE `myserver`.`yabbse_settings` ADD `gmodtemplate` TINYINT DEFAULT '1' NOT NULL

I did this, correct?
Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.


WWW
Re:[Done] Global Moderator center.
« Reply #43 on: May 04, 2002, 06:26:18 PM »
Reply with quote

Actually you need to click browse in the yabbse_settings

Then click insert new row, then add the name gmodtemplate and the value of 1.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Ironman
Guest
Re:[Done] Global Moderator center.
« Reply #44 on: May 04, 2002, 06:33:47 PM »
Reply with quote

Done.  8)

And, so that I can switch it on/off its only 2 more Modifications, right?

In the language File and in the ModSettings.php, if I'm not wrong.
« Last Edit: May 04, 2002, 06:51:26 PM by Ironman » Logged
Pages: 1 2 [3] 4 5 ... 24 Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  Topic: [Done 1.5.1] Global Moderator center. « previous next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.0.18 | SMF © 2021, Simple Machines
Valid XHTML 1.0! Valid CSS!
Page created in 0.148 seconds with 19 queries.