Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-13-2006, 10:14 PM
JamieLee2k's Avatar
JamieLee2k JamieLee2k is offline
 
Join Date: Sep 2006
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Editing PHP code

First of all look at this picture



You see where it says Cancel, Postpone, Delete and Add New Game well I am looking to remove them for normal members and not for admins and so I am wondering if there was anything in this file which relates to being able to remove the code. Normal users use useradmin.php once they are logged in which makes me think this is the file I need to edit.

PHP Code:
<?php
include("config.php");

if(
$_COOKIE["language"]) {
        
$llang $_COOKIE["language"];
} else {
    
$l_array explode("-",$lang_array[0]);
    
$llang $l_array[0];
        
setcookie("language",$llang,time()+1209600,"","","");
}

include(
"lang/".$_COOKIE["language"].".php");

session_start(  );

//SECURITY CHECK #1
if($_COOKIE['PHPSESSID'] == session_id(  ) && $_COOKIE['type'] != "") {

    
$open mysql_connect($_CONF['hostname'],$_CONF['user'],$_CONF['password']);
    
mysql_select_db("$_CONF[db]",$open);

    
$leagueinfo mysql_query("SELECT * FROM ".$_CONF['tprefix']."leagueinfo");
    
$_CONF['logtime'] = mysql_result($leagueinfo,0,"timelength");
    
$_CONF['league_name'] = mysql_result($leagueinfo,0,"name");
    
$_CONF['interdiv'] = mysql_result($leagueinfo,0,"interdiv");
    
$_CONF['gdversion'] = mysql_result($leagueinfo,0,"gd");

    
//SECURITY CHECK #2
    
$cktime $_COOKIE['time'] + ($_CONF['logtime'] * 60);

    if(
date("U") < $cktime) {
        
setcookie("time",date("U"),time()+1209600,"","","");

        
$teams mysql_query("SELECT id,name,contact_email FROM ".$_CONF['tprefix']."teams WHERE contact_email = '$_COOKIE[u]'");
        
$teamid mysql_result($teams,0,"id");
        
$_CONF['teamid'] = $teamid;
        
$_CONF['teamname'] = mysql_result($teams,0,"name");
        
$_CONF['teamemail'] = mysql_result($teams,0,"contact_email");

        
ob_start();
        include(
"includes/header_user.inc");
        
$header ob_get_contents();
        
ob_end_clean();

        
//GET TASK
        
if($_POST['opt']) {
            
$opt $_POST['opt'];
        } else {
            
$opt $_GET['opt'];
        }

        include(
"userfunctions.php");
    
        switch(
$opt) {

        case 
"alist":        //ANNOUNCEMENT LIST
    
            
$header eregi_replace("<!--%formname%-->","ann",$header);
            
$output .= announcement_list($message);
    
        break;
    
            case 
"aform":        //NEW ANNOUNCEMENT HTML FORM
    
                    
$output .= announcement_form();
    
            break;
    
            case 
"asql":        //INSERT NEW ANNOUNCEMENT IN MYSQL
    
                    
$message announcement_sql();
            
$header eregi_replace("<!--%formname%-->","ann",$header);
            
$output .= announcement_list($message);
            break;
    
            case 
"eform":        //EDIT ANNOUNCEMENT HTML FORM
    
                    
$output .= announcement_eform();
    
            break;
    
            case 
"esql":        //UPDATE ANNOUNCEMENT IN MYSQL
    
                    
$message announcement_esql();
            
$header eregi_replace("<!--%formname%-->","ann",$header);
            
$output .= announcement_list($message);
    
            break;

            case 
"ann_delete":    //DELETE ANNOUNCEMENT
    
            
$message .= announcement_delete();
            
$header eregi_replace("<!--%formname%-->","ann",$header);
            
$output .= announcement_list($message);
    
        break;
    
            case 
"info":        //TEAM INFORMATION HTML FORM
    
                    
$output .= teaminfo($message);
    
            break;
    
            case 
"info_sql":    //UPDATE TEAM INFO IN MYSQL
    
            
$message teaminfo_sql(); 
                    
$output .= teaminfo($message);
    
            break;
    
            case 
"players":        //LIST PLAYERS ON TEAM
    
                    
$output .= players($_GET['message']);
    
            break;
    
        
/***** DEFUNCT *****
            case "editteamsch":    //???
    
            editteamsch($date,$time,$location,$team1_score,$team2_score,$team1,$team2,$season);
            $output .= scheduleteam($teamid,$thisdiv);
    
        break;
    
            case "delteamsch":    //???
    
                    $sql = mysql_query("DELETE FROM ".$_CONF['tprefix']."schedule_scores WHERE id ='$id'");
                    $output .= scheduleteam($selectteam,$thisdiv);
    
            break;
        ***** DEFUNCT *****/

            
case "schedule_delete":    //DELETE ONE OR MORE GAMES FROM SCHEDULE
    
            
$message .= schedule_delete();
            
$formname "schedule";
            
$header eregi_replace("<!--%formname%-->",$formname,$header);
            
$output .= scheduleteam($_POST['teamid'],$_POST['thisdiv']);
    
        break;

            case 
"schedule_postpone":    //POSTPONE GAME(S)
    
            
$message .= schedule_postpone();
            
$header eregi_replace("<!--%formname%-->","schedule",$header);
            
$output .= scheduleteam($_POST['teamid'],$_POST['thisdiv']);
    
        break;

            case 
"schedule_cancel":        //CANCEL GAME(S)
    
            
$message .= schedule_cancel();
            
$header eregi_replace("<!--%formname%-->","schedule",$header);
            
$output .= scheduleteam($_POST['teamid'],$_POST['thisdiv']);
    
        break;
    
        default:    
//DISPLAY TEAM'S SCHEDULE
            
$formname "schedule";
            
$header eregi_replace("<!--%formname%-->",$formname,$header);
            
$output .= scheduleteam($teamid,$thisdiv);
    
        }
    } else {
        
header("Location: ./?opt=login&message=error\r\n");
    }
} else {
    
header("Location: ./?opt=login&message=error\r\n");
}

$header eregi_replace("<!--%formname%-->","form",$header);

$output $header.$output."
    </td></tr></table>"
;

echo 
$output;

include(
"includes/footer.inc");
?>
Now when an admin logs in they get a different URL so I am thinking it maybe ok and it isn't effected.

If it means removing a bit of code then so be it I just wanted them 4 buttons removing.

Thanks
JamieLee2k
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:54 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.03530 seconds
  • Memory Usage 2,226KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete