vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Moderator Template Editor (https://vborg.vbsupport.ru/showthread.php?t=43520)

blackice912 09-13-2002 10:00 PM

Moderator Template Editor
 
Hello!

This is my first hack and so far, so good :)

This hack is a Moderator Template Editor. It will allow your moderators to edit their own template on your vb. It's also setup so they can not edit other templates as it only shows theirs.

If you have any questions or have a problem/idea, please post in this thread as I will check it often!

I still plan to addon to this hack with the style and replacements stuff too

Oh, and please hit install if you plan on using it :)

[UPDATE] Security issue fix with Xenon's "Mods can edit users" included for those who use it so that means there are no security issues as far as I know when it comes to non-admins. [/UPDATE]

[UPDATE 2] Changed some code to increase security against people disabling javascript - Change the following to update this hack if you have it installed:

1. Open template.php

2. Find:

if ($expandset=$bbuserinfo[fieldID]) {
echo "";
} else {
echo "<script language=\"javascript\">
<!--

alert(\"You are not authorized to view this area\")
location.replace(\"http://www.yoursite.net/forums/mod/index.php?s=&action=home\");

//-->

</script>";

}

3. Between the } and the </script>"; - add:

die;

[/UPDATE 2]

Pictures will be attached after this thread...

Please visit this thread for the latest version of this hack!

blackice912 09-14-2002 12:18 PM

The button to the editor in the Mod CP

blackice912 09-14-2002 12:19 PM

Mod CP and the templates on the right

blackice912 09-14-2002 12:19 PM

You're a mod that's not authorized to use this template editor!

Dean C 09-14-2002 12:22 PM

so basically it allows mods to create their own template set that only THEY can use???

- Mist

blackice912 09-14-2002 12:26 PM

Say you give a moderator their own forums and want to let them update their template to however they want it. This hack lets them use a template you setup for them and allow them to mod it however without hurting any other templates or forums.

DWZ 09-14-2002 02:16 PM

Wow, this is just what I need. Quick question, am I able to let the mod change more then one template set? i.e. I want them able to edit template sets 2, 3 and 5.

Something you may like to add to your to-do list, it would be good if they were able to access the "Styles" and "Replacements" pages. It would also be nice if they could access features such as Search templates, Download/Upload Styles and maybe even "add style".

You see, I have a forum designer type guy, who is currently set as an administrator. He isn't really an administrator, he just plays around with the templates and all, it would be nice if he was able to do this without me having to risk the fact that he could shut down the forum and everything, although i do trust him, if his password came out and someone got access to it, etc etc...

blackice912 09-14-2002 02:19 PM

Quote:

Originally posted by DWZ
Wow, this is just what I need. Quick question, am I able to let the mod change more then one template set? i.e. I want them able to edit template sets 2, 3 and 5.

Something you may like to add to your to-do list, it would be good if they were able to access the "Styles" and "Replacements" pages. It would also be nice if they could access features such as Search templates, Download/Upload Styles and maybe even "add style".

Right now, I don't think you can set them up for multiple templates (verified, you can't at this moment)...I shall look into that.

And yup I plan on adding styles and replacements to this hack later on :)

Also if you want to let them add styles, then just don't delete that code when you install this (see step 4 in installation file) :)

I just wanted to get this part done since I know a few people who were lookin for it.

Hey I know you....you're on the Myacen forums!

Dean C 09-14-2002 02:43 PM

this is awesome... but i dont want to give my mods this much power ;)

- Mist

blackice912 09-14-2002 02:46 PM

Well you can give it to certain mods :p

I designed this because I know one site who has wanted this for certain groups that have forums on their site as well as my site so my clients can edit their forum to how they see fit.

Dean C 09-14-2002 03:44 PM

true but i dont want to give them this much power anyway.... :D

still a wicked hack !

Regards

- Mist

blackice912 09-14-2002 03:46 PM

Thanks :) Not bad for my first hack I think

Dean C 09-14-2002 04:11 PM

/me agrees :thumbsup:

- Mist

SZ|TalonKarrde 09-14-2002 04:24 PM

Pretty damn nifty.

Marshalus 09-14-2002 04:39 PM

Quote:

Originally posted by blackice912
Well you can give it to certain mods :p

I designed this because I know one site who has wanted this for certain groups that have forums on their site as well as my site so my clients can edit their forum to how they see fit.

Gee, I wonder who he could be talking about? ;)

[high]* Marshalus coughs "Federation Studios"[/high]

blackice912 09-14-2002 04:41 PM

Gee...I think he's right!

SZ|TalonKarrde 09-14-2002 04:42 PM

Quote:

Originally posted by blackice912

Hey I know you....you're on the Myacen forums!

Yep. Another genious who decided myacen was the best host in the world.

Marsh, it's also for SD1. Our clients need to edit their own forums as well =P

blackice912 09-14-2002 04:45 PM

I said that in my post :p

SZ|TalonKarrde 09-14-2002 04:46 PM

Quote:

Originally posted by blackice912
I said that in my post :p
I didn't see the and in there, lol.

NTLDR 09-14-2002 05:58 PM

Excelent first hack blackice912! I'm sure many people will benifit from this. Thanks for sharing with the community :)

blackice912 09-14-2002 06:00 PM

Thank you :)

snyx 09-14-2002 07:05 PM

just what I needed, sweet thx bro!

blackice912 09-14-2002 07:26 PM

No problemo :)

DWZ 09-14-2002 11:47 PM

Quote:

Originally posted by blackice912
Right now, I don't think you can set them up for multiple templates (verified, you can't at this moment)...I shall look into that.

And yup I plan on adding styles and replacements to this hack later on :)

Sounds good :)
Quote:

Originally posted by blackice912
Also if you want to let them add styles, then just don't delete that code when you install this (see step 4 in installation file) :)

ahh, ok, but I guess it won't be much use until they are able to edit more then one template set :(
Quote:

Originally posted by blackice912
I just wanted to get this part done since I know a few people who were lookin for it.

yep, thats cool :)
Quote:

Originally posted by blackice912
Hey I know you....you're on the Myacen forums!

lol, yep, thats me :)

blackice912 09-15-2002 02:01 AM

Quote:

Originally posted by DWZ
ahh, ok, but I guess it won't be much use until they are able to edit more then one template set :(
Curious, are we thinking about different things? When I say template set, I think all of the templates in a template group.

Chris M 09-15-2002 10:30 AM

Template Set usually means things like "Default", "Style 1" etc...

Es ist sehr gut Herr blackice912:)

*installs*

Satan

blackice912 09-15-2002 10:32 AM

Yeah, exactly what I was thinkin in my head Hellsatan

And danke Hellsatan :)

Chris M 09-15-2002 10:43 AM

Np;)

Was gibt es neues?

Satan

blackice912 09-15-2002 10:47 AM

My German is limited to very limited translating programs, so I have no idea what you are asking :) heh

Xenon 09-15-2002 10:53 AM

he asked something new? ^^

anyway i see you have modified my edit user hack for securiti reasons, but i think you have forgotten one thing:

you just disabled the inputbox if the varname is fieldID, but you didn't disable the DB change so it'll overwrite the value with an empty value if i'm not wrong.

so you also have to edit this part of my hack if i'm right:
PHP Code:

if($canedit[profilefields]) {
    
$profilefields=$DB_site->query("SELECT profilefieldid,title FROM profilefield");
    while (
$profilefield=$DB_site->fetch_array($profilefields)) {
      
$varname="field$profilefield[profilefieldid]";
      
$sql.=",field$profilefield[profilefieldid]='".addslashes($$varname)."'";
    }
    
$DB_site->query("UPDATE userfield SET userid=$userid$sql WHERE userid=$userid");
  } 


Chris M 09-15-2002 10:56 AM

Any news?

About the styles add-on thingy I mean;)

Satan

blackice912 09-15-2002 10:57 AM

Xenon:

Nope, because it doesn't even pull the info from the database and place it in the page. I've tested it over and over in my forums and it works fine.

By the way, wonderful hack you made :) My moderators jumped for joy when I installed it.

blackice912 09-15-2002 10:59 AM

Quote:

Originally posted by hellsatan
Any news?

About the styles add-on thingy I mean;)

Satan

Oh, heh that's next on my list. :) Probably later today since I just finished the replacement editor and published it.

Chris M 09-15-2002 11:07 AM

I saw;):)

I dont usually mess with replacements myself, so my mods or others wouldnt be interested:D

:)

Satan

blackice912 09-15-2002 11:10 AM

Yeah I don't usually either, but hey :)

Xenon 09-15-2002 11:31 AM

Thanks, it's good to know my hacks are used ;)

ok, i've just had a brief look at the code, if it works good :)

blackice912 09-16-2002 02:15 AM

Security Update!

Changed some code to increase security against people disabling javascript

Go to page 1 and grab the new code

snyx 09-16-2002 04:32 AM

I have a problem were it will show my main set (1)
but it will not show my template set 4!?

it just says the title of the set 1 (being light)
any ideas??

I coded it twice right! :)

snyx 09-16-2002 04:39 AM

wait my style id for it is 5, and my template id is 4
could this be the problem?

how could I fix it?

blackice912 09-16-2002 07:07 AM

I'm going to look into that right now


All times are GMT. The time now is 11:07 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01378 seconds
  • Memory Usage 1,818KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete