vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [RELEASE] Apply to be Mod or Admin. VIA Email. (https://vborg.vbsupport.ru/showthread.php?t=48377)

MetroSports82 04-09-2003 04:10 PM

ok, so you guys want this mod application (by: Logik), to start a "new thread" in a forum of your choice, after a user has submited the application, correct? Here it tis. :)

In mod.php

FIND:
PHP Code:

$subject "$bbuserinfo[username] applying for mod/admin"

ADD BELOW THAT:
PHP Code:

$modforum="110"// type in your forum id number here
    
$DB_site->query("INSERT INTO thread  (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."','".time()."','$modforum','1','0','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".addslashes($bbuserinfo[username])."','".time()."','$iconid','1','0')");
    
$threadid=$DB_site->insert_id();
    
$DB_site->query("INSERT INTO post  (postid,threadid,title,username,userid,dateline,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','Post Alert - $postinfo[username]','$bbuserinfo[username]','$bbuserinfo[userid]','".time()."','".addslashes(parseurl($email))."','$allowsmilie','$signature','$ipaddress','$iconid','1')");
    
$DB_site->query("UPDATE forum SET replycount=replycount+1,lastpost='".time()."',lastposter='$bbuserinfo[username]' WHERE forumid='$modforum'"); 

Now, just make ( $modforum ="110" ; ) the forum id number of your choice, and your done! I have forum id 110 as one of my private forums to use. :) Anyway, let me know if you have any problems with, and how that comes out. All the credit must be handed out to Logik though, I was not the one that created this hack, so please do not thank me, but him. ! :) Thanks Logik!!! ;)

cheers,
-Metro.

MetroSports82 04-09-2003 05:12 PM

BTW, almost forgot. There is also a quick fix, on to size of the "text box", (where your users would type in why they would like to become a mod), via templates. I have inserted a screenshot to show you what I mean.

Anyway, to accomplish this...

In your "mod" template-

FIND:

Code:

<textarea name="message"></textarea>
REPLACE THAT WITH:
Code:

<textarea rows="17" cols="87" name="message"></textarea>
Or, if you want to use a custom size, just simply play around with the ROWS and COLS #'s, to get the size your looking for. :)

thanks,
Metro.

Funkie 04-09-2003 05:32 PM

getting a prase error on the first line:(

$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,postuserid,lastpos

will have a fiddle about with ,thanx for the info

laycomp 04-09-2003 05:46 PM

Had he given the files to Logik as he requested perhaps things could get off to a good start, but doesn't want to do that. I stand as I stated earlier.

MetroSports82 04-09-2003 05:47 PM

Funkie, try sending me your mod.php file, and I'll have a look at it. :)

Funkie 04-09-2003 05:53 PM

will attach it here for you fella
This is the basic mod.php file.I have removed the extra code:)

Thanx for the help

MetroSports82 04-09-2003 05:55 PM

Quote:

Today at 02:46 PM laycomp said this in Post #44
Had he given the files to Logik as he requested perhaps things could get off to a good start, but doesn't want to do that. I stand as I stated earlier.
I agree, I totally take the blame on my part. I should have (like you said) given the file to Logik first, but rather took the wrong approach. But, I'll be honest.. I'm a little new to this hacking stuff. (not the forum), but modifying and stuff like that. Heck, I'm still working on releasing my first ever hack here, which I'm still in the process of working on. :D But, I'm not that kind of person to not give credit, where its due. Seriously. I dunno what other way to tell ya, but my deepest apologies to Logik, and his awesome hack. Wish I could go back and undo what I said 2 days ago. :(

thanks,
Metro.

MetroSports82 04-09-2003 06:12 PM

Funkie, ok try this one.

Now, all you'll need to do is to change the $modforum number to the forum of your choice.

PHP Code:

$modforum="103"

To do that. Simply change the number '103', in this file, to the forum id number you want to use. Let me know how this comes out for ya. Its working for me, on 2.2.9. and should really work for any version before and after this one. :)

thanks,
Metro.

Funkie 04-09-2003 06:20 PM

Sorted fella:)
Many thanx.posts into the right forum just the 1 time now:)

Is there any way this can be modded to work outside of the forums folder.ie root so it can be used then for outsiders to apply to become a member.

Just a thought please dont flame me.lol

Big ups to you all for your work on all the mods/hacks

Thanx

Logik 04-09-2003 11:08 PM

Be more spacific. I havnt made a hack in ages. I might can do this for you.

Logik 04-09-2003 11:08 PM

if you used it, click install :)

Funkie 04-10-2003 03:59 AM

I will click install when its added to my live board:)Still testing it right now.

Quote:

Be more spacific. I havnt made a hack in ages. I might can do this for you

Instructions:
====================
1). Upload mod.php to your forums root.
*************************************************

It works fine if the mod.php is in the forum folder.

How can you get it to work say from your homepage,if your homepage is in a diff folder than your forums folder.

Logik 04-10-2003 11:03 PM

Be more spacific before i post what to do.

Logik 04-10-2003 11:10 PM

If i understand you right. Just edit your templates, and find, /forums/, and make that the path of the mod.php. Then in the link, config it too. Like this

PHP Code:

<a href="/dir/mod.php?action=apply">Want to be a mod or an admin?</a


Funkie 04-11-2003 04:34 AM

Fatal error: Failed opening required './global.php' (include_path='') in /home/xxxxxx/public_html/forums/mod.php on line 9

thats what i get if i try to open the mod.php in another folder from the main forum folder

I tryed to change the path to the global.php in the mod.php file but then all i get is a blank page:(:(

Sorry for all the hassle guys,but its a wicked hack,and i would luv to get it working from outside the forums folder say in my domains root.

IE=http://www.yoursite.com/mod.php

and not http://www.yoursite.com/forum/mod.php

N9ne 04-11-2003 09:08 AM

Logik, i don't think that users should be able to enter their username and password. This could easily be abused! What would be better, is using a hidden form field with $bbuserinfo['username'], $bbuserinfo['userid'], $bbuserinfo['email']

So these can't be changed, and there's no way of it being abused :).

Great work on the hack, thanks.

Logik 04-11-2003 08:49 PM

Ok. @frankie. Thats because it requirs global.php. To use the header and all. Explain, why do you want this hack in another location?

Logik 04-11-2003 08:50 PM

@n9ne, good idea. I didnt even think of that. But too many people have already downloaded it. If you wouldnt mind, if you did this, post your mod.php. :) thanks.

Funkie 04-12-2003 12:35 AM

The board i was thinking about using it on,is a private closed board.I was going to use the hack on the main website for peeps to fill out then apply to join the board.
As it would then post all the details in a forum,for the other members to vote on,and alert the admins of the new post.

Yes i know about the reg page in vb,and adding the users in moderation and all,but like the idea of the posting into the forum.

Logik 04-12-2003 03:59 AM

Hmm. Anyone wanna help me here. Im not to sure on how to do this. Because it requires global.php..

Funkie 04-12-2003 06:09 AM

@Logik,
Thanx for the time in replying fella.
Its a nice lill hack,many thanx

Logik 04-12-2003 06:15 AM

Ok. Anything else. I will help you with it.

Funkie 04-12-2003 09:23 AM

Ho BTW,
/me clicked install

N9ne 04-12-2003 10:46 AM

If you want it posted into a forum, simply add a query to the submit part of the form, where it inserts into the thread and post tables, and you can set the forumid when entering into the thread table, as there's a forumid field I believe. I don't have time to go into detail, but that's the basic outline and should give you a good enough idea.

Funkie 04-12-2003 11:35 AM

Quote:

If you want it posted into a forum, simply add a query to the submit part of the form, where it inserts into the thread and post tables, and you can set the forumid when entering into the thread table, as there's a forumid field I believe. I don't have time to go into detail, but that's the basic outline and should give you a good enough idea

Ummmmmmm it does that,but my problem is using this mod from outside the forums root folder in a diff folder,on the same server.

I need to know how to call the global.php from outside the forum.

thanx for the input anyway.

N9ne 04-12-2003 12:22 PM

require('forums/global.php'); I believe.

Funkie 04-12-2003 12:49 PM

Fatal error: Failed opening required './global.php' (include_path='') in /home/xxxx/public_html/mod.php on line 9

N9ne 04-12-2003 12:50 PM

It says failed opening ./global.php ? it should have the directory of your forums before it.

Funkie 04-12-2003 01:12 PM

ehhe,yup changed the wrong file.
ok done that now all i get is a blank white page no errors??????????

N9ne 04-12-2003 01:33 PM

I'm not really sure what's wrong, all I know is that require call is what's used in vB to use global.php so I figured it could be used out of vB. Are you sure you've connected to the database and everything?

Funkie 04-12-2003 01:42 PM

The hack works fine when the mod.php is in the same folder as the vb files,but when i tyr to use it outside of the vb folder,all i get is a blank page now.

Ho well will uninstall it now,many thanx for all your help,and to logik for the hack.

Better luck next time

:)

N9ne 04-12-2003 01:48 PM

If it's template driven, it might give a blank page...

Funkie 04-12-2003 02:05 PM

ok next question then how do i pull the templates into it?????or can i not,

Logik 04-12-2003 07:55 PM

Explain what you mean.. I dont understand. Sorry.

Logik 04-12-2003 07:56 PM

Blank page.. Hmm. I have no idea why its doing that.. Make sure your connected to the DB and all that.

Logik 04-12-2003 07:59 PM

Make sure the require code is after <?. And it SHOULD work.

Funkie 04-12-2003 08:59 PM

PHP Code:

<?php
   
// Apply to be mod/admin  by Logik.
 
if (!isset($action) or $action=="") {
  
$action="apply";
}
$version "1";
// ############################### start apply ###############################
if ($action=="apply") {
require(
"./global.php");
$templatesused='mod';
eval(
"dooutput(\"".gettemplate("mod")."\");");
}
?>
<?php
// ############################### start send request ###############################
if ($action=="send") {
 require(
"./global.php");

  
$templatesused 'mod_thanks';
 if(
$message==""){
eval(
"dooutput(\"".gettemplate("moderror_nomessage")."\");");
}elseif (
$name==""){
eval(
"dooutput(\"".gettemplate("moderror_noname")."\");");
}elseif (
$position==""){
eval(
"dooutput(\"".gettemplate("moderror_noposition")."\");");
}else{
   
$email "$bbtitle Application\n\nSender Username:\t$name\nSender E- Mail:\t$thereemail\nMessage:\t$message\nSender Site:\t$site\nPosition:\t$position\nIP:\t$REMOTE_ADDR\n\n";
$to "$webmasteremail";
$subject "$bbuserinfo[username] applying for mod/admin";
$mailheaders "From: $thereemail <> \n";
$mailheaders .= "Reply-To: $thereemail\n\n";
mail($to$subject$email$mailheaders);
eval(
"dooutput(\"".gettemplate("mod_thanks")."\");");
}
}
?>


Logik 04-12-2003 09:38 PM

I see the problem.. Ok. The mod.php isnt in the forums folder. ITs outside of it. So therefor you have to do,
PHP Code:

require('forums/global.php'); 


Funkie 04-12-2003 10:01 PM

I tryed:
require('forums/global.php'); and i get the cant open global again,,,,,so i changed it back to require('welcome/global.php');
and the error goes,but all i get is the blank page:(

Iam not gonna take up anymore of your time guy's this fine hack was not made to do what i would like.

thanx for all your time spend .

Logik 04-13-2003 02:50 AM

Are you sure that your forums dir is Forums?


All times are GMT. The time now is 08:29 AM.

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.01280 seconds
  • Memory Usage 1,845KB
  • 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
  • (2)bbcode_code_printable
  • (6)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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