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

Reply
 
Thread Tools Display Modes
  #11  
Old 01-28-2009, 03:59 AM
BlackJacket's Avatar
BlackJacket BlackJacket is offline
 
Join Date: Nov 2008
Location: 070108111114105100100
Posts: 364
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Well, that article should just give you a basic vb page with the header and navbar up top and a footer at the bottom and whatever you put in the template in the middle. If you include the global.php page and then that no permission code you posted in your php page, it should restrict access to your page. It's hard to tell what is wrong without seeing the php code.

I can PM it to you. Is that ok?
Reply With Quote
  #12  
Old 01-28-2009, 05:12 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any reason why you cannot simply post it?
Reply With Quote
  #13  
Old 01-28-2009, 09:54 AM
BlackJacket's Avatar
BlackJacket BlackJacket is offline
 
Join Date: Nov 2008
Location: 070108111114105100100
Posts: 364
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
Is there any reason why you cannot simply post it?
I have some php that requires my username and pass for the DB.

I dont know if you guys want the code all cut up because i would have to remove that information. You wouldnt be able to see the full code.
Reply With Quote
  #14  
Old 01-28-2009, 10:07 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just blank out the username and password (should only be once, anyway), and post the code. Unless there is more sensitive information?
Reply With Quote
  #15  
Old 01-28-2009, 10:28 AM
BlackJacket's Avatar
BlackJacket BlackJacket is offline
 
Join Date: Nov 2008
Location: 070108111114105100100
Posts: 364
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
Just blank out the username and password (should only be once, anyway), and post the code. Unless there is more sensitive information?
Ok.

HTML Code:
<?php
$curdir = getcwd ();
chdir('Edited..html/community');
require_once('edited/community/global.php');
chdir ($curdir);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>1320LEGEND | Legend Manual</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="en" />
<meta name="description" content="Guide to playing 1320LEGEND. Learn to Race, Tune, Shop, plus much more on the Free Online Drag Racing game, 1320LEGEND!" />
<meta name="keywords" content="1320, 1320 legend, guide, tune help, learn tuning, manual" />
<link href="../style.css" rel="stylesheet" type="text/css" />
<link href="../layout.css" rel="stylesheet" type="text/css" />
</head>

<body id="page3">
	<div class="tail-top">
      <div class="tail-center">
         <div id="main">
            <!-- header -->
            <div id="header">
               <!--Valid flash version 8.0-->
               <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                          codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,24"
                          width="980" height="295">
               <param name="movie" value="flash/header3_fv8.swf?button=3" /> 
               <param name="quality" value="high" />
               <param name="menu" value="false" />
               <param name="wmode" value="transparent" />
               <!--[if !IE]> <-->
               <object data="flash/header3_fv8.swf?button=3"
                          width="980" height="295" type="application/x-shockwave-flash">
               <param name="quality" value="high" />
               <param name="menu" value="false" />
               <param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />
               <param name="wmode" value="transparent" />
               FAIL (the browser should render some flash content, not this).
               </object>
               <!--> <![endif]-->
               </object>
            </div>
            <!-- content -->
            <div id="content">
            	<div class="main-box">
               	<div class="top">
                  	<div class="bottom">
                     	<div class="inside">
                        	<div class="wrapper">
                           	<div class="left-column">
                              	<div class="box">
                                 	<div class="top">
                                    	<div class="bottom">
                                       	<div class="inner">
                                          	<h2>1320LEGEND Login</h2>
                                             <div class="inner1">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
	<td class="alt1" width="100%">
<?php
   require_once('/home/content/n/i/t/nittospace/html/community/login_inc.php');
?>   

	</td>	
	

	
</tr>
</table>
                                             </div>
                                             <h3>Recent Topics</h3>
                                             <div class="inner1">
                                             	<?php 
##########################################################################
// RECENT TOPICS by LBmtb
// Version 1.03
// webmaster@socaltrailriders.org OR aim: LBmtb
//
// Do not remove copyright unless you donate $5 via paypal
// to the above email address, thanks
// CUSTOMIZED from a www.phase1media.com script found here:
// https://vborg.vbsupport.ru/showpost.php?p=589067&postcount=7
##########################################################################

## CUSTOMIZE THE FOLLOWING    ##############################################

// DATABASE & URL SETTINGS
$db_host = "p50mysql283.secureserver.net"; // Change this if your MySQL database host is different.
$db_name = ""; // Change this to the name of your database.
$db_user = ""; // Change this to your database username.
$db_pw = ""; // Change this to your database password.
$db_prefix = ""; // Change to your tables' prefix. Usually vb_
$forum_url = "http://www.1320legend.com/community"; // Change this to reflect to your forum's URL.

// APEARANCE OPTIONS
$seperator = "@"; // this goes between last poster and date
$limit = "3"; // Number of posts displayed
$post_date_format = "1"; // leave as 1 for "12/18/06 05:26 PM" or change to 2 for "05:26 PM"

// use one or the other, not both. if left blank the script will return threads from any forum
$fid_raw = ""; // ONLY include threads from these forums. seperate each ID with a comma
$fidx_raw = ""; // Exclude threads from these forum. seperate each ID with a comma

// CSS CLASSES    
$recent_topics = "vb_topics"; // you can use CSS to adjust the presentation of the list 
$recent_poster = "vb_last_post";  // you can use CSS to adjust the presentation the last poster and date

## NO NEED TO TOUCH ANYTHING BELOW    #####################################
#############################################################################

if (!($recent_topics_connection = mysql_connect("$db_host", "$db_user", "$db_pw")))
die ("could not connect"); 
if (!(mysql_select_db("$db_name", $recent_topics_connection)))
mysql_error(); 
echo "<ul class=\"$recent_topics\">\n";
$fid_array = explode (',', $fid_raw);
if ($fid_raw)  {
    $fid_final .= "AND (";
    foreach( $fid_array as $key => $value){
        if ($key == 0) { $fid_final .= "t.forumid=".$value; }
        else { $fid_final .= " OR t.forumid=".$value; }
    }
    $fid_final .= ")";
}
$fidx_array = explode (',', $fidx_raw);
if ($fidx_raw)  {
    $fidx_final .= "AND NOT (";
    foreach( $fidx_array as $key => $value){
        if ($key == 0) { $fidx_final .= "t.forumid=".$value; }
        else { $fidx_final .= " OR t.forumid=".$value; }
    }
    $fidx_final .= ")";
}
$thread_sql = mysql_query("SELECT SQL_CACHE t.threadid,t.title,t.lastpost,t.lastposter,t.forumid,substring(p.pagetext,1,90) as post_text
	FROM ".$GLOBALS['db_prefix']."thread t
	INNER JOIN ".$GLOBALS['db_prefix']."post p
	ON t.firstpostid = p.postid
	WHERE t.visible=1 
	AND t.open=1 $fidi_final $fidx_final 
	ORDER BY t.lastpost desc 
	LIMIT $limit");
while($thread_get=@mysql_fetch_array($thread_sql))
{
    $lastpost = $thread_get['lastpost'];
    $poster = $thread_get['lastposter'];
    $tid = $thread_get['threadid'];
$text = $thread_get['post_text'];
    if ($post_date_format == "1") { $date2 = date ("m/d/y h:i A" ,$lastpost); }
    elseif ($post_date_format == "2") { $date2 = date ("h:i A" ,$lastpost); }
    else { $date2 = date ("m/d/y h:i A" ,$lastpost); }
	    echo "<li><a href=\"$forum_url/showthread.php?t=$tid\" title=\"".$text."\">$thread_get[title]</a> <span class=\"$recent_poster\">($poster $seperator $date2)</span></li>\n";
}
mysql_close($recent_topics_connection);
?> 
                                                <div class="txt1"><strong>
													<a href=""></a></strong></div>
                                             </div>
                                             <div class="alignright">
												 <a class="link1" href="../community/index.php">Read More</a></div>
                                          </div>
                                       </div>
                                    </div>
                                 </div>
                              </div>
                              <div class="center-column">
                              	<div class="box1">
                                 	<div class="border-top">
                                    	<div class="border-right">
                                       	<div class="border-bot">
                                          	<div class="border-left">
                                             	<div class="left-top-corner">
                                                	<div class="right-top-corner">
                                                   	<div class="right-bot-corner">
                                                      	<div class="left-bot-corner">
                                                         	<div class="inner2">
                                                            	<h2>Legend Guide</h2>
                                                            	<p>Welcome to the Moderator Control Panel.  More info will be posted soon as well as more tools.  The navigation links above (Garage, Forums, etc...) are not working yet.  Please 
																<a href="http://1320legend.com/index.php">click here</a> to go to the index or Garage.</p>
																				<p><a href="http://1320legend.com/community/forumdisplay.php?f=35" target="_blank">Click here</a> for Mod Lounge</p>
																				<p><a href="http://1320legend.com/community/modcp/index.php" target="_blank">Mod Control Panel for forum</a></p>
																	
                                                            </div>
                                                         </div>
                                                      </div>
                                                   </div>
                                                </div>
                                             </div>
                                          </div>
                                       </div>
                                    </div>
                                 </div>
                              </div>
                           </div>
                        </div>
                     </div>
                  </div>
               </div>
            </div>
            <!-- footer -->
            <div id="footer">
            	<p>1320LEGEND ? 2008&nbsp;&nbsp; |&nbsp;&nbsp; ReaxtionStudios.com&nbsp;&nbsp; 
				|&nbsp;&nbsp; <a href="privacy-policy.html">Privacy Policy</a>&nbsp; |&nbsp; 
				<a href="refund-policy.html">Refund Policy</a></p>
				<p><span id="siteseal"><script type="text/javascript" src="https://seal.godaddy.com/getSeal?sealID=164585129504c246eb212711e1ddf4d2b17df9063538959879293121"></script><br/></span></p>            </div>
         </div>
      </div>
   </div>
</body>
</html>
Reply With Quote
  #16  
Old 01-28-2009, 02:15 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your no permission should go right at the top after you include global.php:

HTML Code:
<?php
$curdir = getcwd ();
chdir('Edited..html/community');
require_once('edited/community/global.php');
if (!is_member_of($vbulletin->userinfo, 6) AND !is_member_of($vbulletin->userinfo, 7))   
{   
        print_no_permission();   
}  
chdir ($curdir);
?>
Reply With Quote
  #17  
Old 01-28-2009, 03:28 PM
BlackJacket's Avatar
BlackJacket BlackJacket is offline
 
Join Date: Nov 2008
Location: 070108111114105100100
Posts: 364
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Your no permission should go right at the top after you include global.php:

HTML Code:
<?php
$curdir = getcwd ();
chdir('Edited..html/community');
require_once('edited/community/global.php');
if (!is_member_of($vbulletin->userinfo, 6) AND !is_member_of($vbulletin->userinfo, 7))   
{   
        print_no_permission();   
}  
chdir ($curdir);
?>
Did that but it does that whole big log in box thing that looks horrible.

Maybe if i could just hide the text instead? Do you know how to do that?

Thank you Lynne for dealing with my issues, lol.
Reply With Quote
  #18  
Old 01-28-2009, 05:12 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Aaaaaaacccccckkkkkk! Now I know what you are talking about! Geez, sometimes it takes me a few minutes... or days... argh!

OK, I think what may be better for you is in your template, go like this:
HTML Code:
<if condition="is_member_of($bbuserinfo, 6, 7)">
put all the stuff for your mods and admins here
<else />
put your message that says they have no permission to be on this page
</if>
Reply With Quote
  #19  
Old 01-28-2009, 05:20 PM
BlackJacket's Avatar
BlackJacket BlackJacket is offline
 
Join Date: Nov 2008
Location: 070108111114105100100
Posts: 364
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Aaaaaaacccccckkkkkk! Now I know what you are talking about! Geez, sometimes it takes me a few minutes... or days... argh!

OK, I think what may be better for you is in your template, go like this:
HTML Code:
<if condition="is_member_of($bbuserinfo, 6, 7)">
put all the stuff for your mods and admins here
<else />
put your message that says they have no permission to be on this page
</if>
Can i put that anywhere or does have to be after global.php?
Reply With Quote
  #20  
Old 01-28-2009, 05:39 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That would go into the template. Except, you aren't using a template are you. Ugh. OK, then back to php.... you will have to put a condition around all the html in your page that you don't want users to see and then another condition around the html in your page that you do want the users to see - like this:

PHP Code:
<?php

if (is_member_of($vbulletin->userinfo67))  
{   
?>
a bunch of html to only show to users in group 6 or 7
<?php

}  
?>
And then, when you have html that you only want to show to the non mods/admins:

PHP Code:
<?php

if (!is_member_of($vbulletin->userinfo67))     
{   
?>
a bunch of html to only show to users NOT in group 6 or 7
<?php

}  
?>
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 05:09 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.04585 seconds
  • Memory Usage 2,304KB
  • 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
  • (5)bbcode_html
  • (2)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete