


1.    User  user_vip :  INT,  9 ( ),  ,    0 
SQL-  : 
ALTER TABLE `slaed_users` ADD `user_vip` INT( 9 ) DEFAULT '0' NOT NULL AFTER `user_id` ;


2.       

				|	   
			+----------------------------------------------------
				|	1	2	3	4	...	11	22 	33	...	111
------------------------------------------------+----------------------------------------------------
Files				|	+	-	-	-		-	-	-		-
Pages				|	-	+	-	-		-	-	-		-
 		|	-	-	+	-		-	-	-		-
 		|	-	-	-	+		-	-	-		-

...				|

   ;))	|	-	-	-	-		-	-	-		+

    $flag
     Files    1, 13  31  ..,   11, 111  191,    .
    1113             .


3.   admin/modules/user.php  ,   .


4.          ,     .

5.     ,      .

6.      " -->"

7.1.    ,       switch($op) -    Files      

--------------------------------------------------------------------

<?php
if (!defined('MODULE_FILE')) {
	Header("Location: ../../index.php");
	exit;
}
$module_name = basename(dirname(__FILE__));
require_once("modules/$module_name/admin/config.php");
get_lang($module_name);

#####################################
#           #
#####################################

#    
global $user, $db;
	getusrinfo($user);
	$uname = $userinfo['username'];
	
$result = $db->sql_query("SELECT user_vip FROM ".$user_prefix."_users WHERE username='$uname' ");
list($user_vip) = $db->sql_fetchrow($result);

$flag=substr_count("$user_vip", "1");

if ($flag<>1) { # ,        1
include("header.php");
OpenTable();
echo"<center><font class=\"title\"><b> </b></font></center>"; 
CloseTable();

OpenTable(); echo"<center> ,        - . <br>
  <a href=\"index.php?name=Contact\" >  </a>     .</center>"; 
CloseTable();
include("footer.php");
	} else { # ,        1
#           

switch($op) {
	case "showcat":
    showcat($cid);
    break;

    case "cat":
    cat($cid);
    break;

    case "view_file":
    view_file($lid);
    break;

    case "pool":
    pool($lid, $send_reiting);
    break;

    case "getit":
    getit($lid);
    break;

    case "broken":
    broken($lid);
    break;

    case "add_file":
    add_file();
    break;

    case "file_send":
    file_send($title, $description, $cid, $filelink, $imglink, $author, $authormail, $authorurl, $f_version, $file_size);
    break;

    default:
    mainfiles();
    break;
}
}#
?>

---------------------------------- ----------------------------------


7.2.     ,    -    Topics.  ,    

<?php
if (!defined('MODULE_FILE')) {
	Header("Location: ../../index.php");
	exit;
}
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = "$defis "._TOPICS."";

#    
global $user, $db;
	getusrinfo($user);
	$uname = $userinfo['username'];
	
$result = $db->sql_query("SELECT user_vip FROM ".$user_prefix."_users WHERE username='$uname' ");
list($user_vip) = $db->sql_fetchrow($result);

$flag=substr_count("$user_vip", "1");

if ($flag<>1) { # ,        1
include("header.php");
OpenTable();
echo"<center><font class=\"title\"><b> </b></font></center>"; 
CloseTable();

OpenTable(); echo"<center> ,        - . <br>
  <a href=\"index.php?name=Contact\" >  </a>     .</center>"; 
CloseTable();
include("footer.php");
	} else { # ,        1
#           


include("header.php");
OpenTable();
echo "<center><font class=\"title\"><b>"._ACTIVETOPICS."</b></font><br><br>"
."<form action=\"index.php?name=Search\" method=\"post\">"
."<input type=\"name\" name=\"query\" size=\"30\">"
." <input type=\"submit\" value=\""._SEARCH."\"></form></center><br>";

$sql = "SELECT T.topicid, T.topicname, T.topicimage, T.topictext, SUM(S.counter) AS sum_counter, COUNT(DISTINCT(S.sid)) AS count_stories FROM ".$prefix."_topics T LEFT JOIN ".$prefix."_stories S ON S.topic=T.topicid WHERE time <= NOW() GROUP BY T.topicid ORDER BY T.topicname";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
	$topicid = intval($row['topicid']);
	$topicname = stripslashes($row['topicname']);
	$topicimage = stripslashes($row['topicimage']);
	$topictext = stripslashes(check_html($row['topictext'], "nohtml"));
	$reads = intval($row['sum_counter']);
	$numrows = intval($row['count_stories']);
	$gg = $numrows;
	$ThemeSel = get_theme();
	if (@file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
		$t_image = "themes/$ThemeSel/images/topics/$topicimage";
	} else {
		$t_image = "$tipath$topicimage";
	}
	echo "<br><center><font class=\"title\"><b>$topictext</b></font></center><br>"
	."<table border=\"0\" width=\"100%\" align=\"center\" cellpadding=\"3\" cellspacing=\"0\" class=\"bodyline\">"
	."<tr><td valign=\"top\" width='25%'>\n"
	."<a href=\"index.php?name=News&new_topic=$topicid\"><img src=\"$t_image\" border=\"0\" alt=\"$topictext\" title=\"$topictext\" hspace='5' vspace='5'></a><br><br>"
	."<font class=\"content\">"
	."<b>"._TOPIC.":</b> $topictext<br>"
	."<b>"._TOTNEWS.":</b> $numrows<br>"
	."<b>"._TOTREADS.":</b> $reads</font>"
	."</td><td valign='top'>";
	if ($gg != 0) {
		$limit = intval($top);
		$sql = "SELECT S.sid, S.catid, S.title, C.title As cat_title FROM ".$prefix."_stories S LEFT JOIN ".$prefix."_stories_cat C ON C.catid=S.catid WHERE topic='$topicid' AND time <= NOW() ORDER BY sid DESC LIMIT 0,$limit";
		$result2 = $db->sql_query($sql);
		while ($row2 = $db->sql_fetchrow($result2)) {
			$sid = intval($row2['sid']);
			$catid = intval($row2['catid']);
			$title = stripslashes(check_html($row2['title'], "nohtml"));
			$rtitle = stripslashes(check_html($row2['cat_title'], "nohtml"));
			if ($catid == 0) {
				$cat_link = "";
			} else {
				$cat_link = "<a href='index.php?name=News&file=categories&op=newindex&catid=$catid'>$rtitle</a> - ";
			}
			echo "<img src='modules/$module_name/images/arrow.gif' border='0' alt='$title' title='$title'>&nbsp;&nbsp;$cat_link<a href='index.php?name=News&file=article&sid=$sid' title=\"$title\">$title</a><br>";
		}
		if ($gg > $limit) {
			echo "<a href=\"index.php?name=News&new_topic=$topicid\" title=\""._MORE."\"><img src=\"modules/$module_name/images/arrow.gif\" border=\"0\" alt=\""._MORE."\">&nbsp;&nbsp;<b>"._MORE."</b></a>";
		}
	}
	echo "</td></tr></table>";
}
CloseTable();
include ("footer.php");
}#
?>

---------------------------------- ----------------------------------


7.3.  , ,   " ".
  . ,   

--------------------------------------------------------------------
global $user, $db;
	getusrinfo($user);
	$uname = $userinfo['username'];
	
$result = $db->sql_query("SELECT user_vip FROM ".$user_prefix."_users WHERE username='$uname' ");
list($user_vip) = $db->sql_fetchrow($result);

$flag=substr_count("$user_vip", "1");

if ($flag<>1) { echo "  ,  <a href=\"index.php?name=Contact\" >  </a>";}
else {echo "<a href=\"http://www.slaed.net\" ></a>";}

---------------------------------- ----------------------------------




        .
     print58@yandex.ru

 , Serg_pnz