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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 01-09-2007, 05:44 AM
Theplayer Theplayer is offline
 
Join Date: May 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you mean this file "forums_vb_func.php"

Code:
<?
if(file_exists("{$CONFIG['dir_config']}/forums_vb.inc.php")) {
	include("{$CONFIG['dir_config']}/forums_vb.inc.php");
}
//////////////////////////////////////////////////////////////////////////////////////
// VARIABLE MAP                                                                     //
//////////////////////////////////////////////////////////////////////////////////////
$MAP_DB=array();
$MAP_DB['comment_id']		=	'nnet_rid';
$MAP_DB['article_id']		=	'nnet_aid';
$MAP_DB['category_id']		=	'nnet_cid';
$MAP_DB['comment_uid']		=	'nnet_uid';
$MAP_DB['comment_uname']	=	'nnet_poster';
$MAP_DB['comment_title']	=	'nnet_title';
$MAP_DB['comment_rate']		=	'nnet_rate';
$MAP_DB['comment_msg']		=	'nnet_msg';
$MAP_DB['comment_date']		=	'nnet_date';
//////////////////////////////////////////////////////////////////////////////////////
// REQUIRED FUNCTIONS                                                               //
//////////////////////////////////////////////////////////////////////////////////////
if(PHP_ACCESS!='1'){
	print "This file doesn't support direct access.";
	exit;
}
function forums_comment_insert($input){
	global $CONFIG,$MAP_DB;
	mysql_query("INSERT INTO `{$CONFIG['sql_db']}`.`nnet_reviews` SET `{$MAP_DB['article_id']}`='{$input['article_id']}',`{$MAP_DB['category_id']}`='{$input['category_id']}',`{$MAP_DB['comment_uid']}`='{$input['comment_uid']}',`{$MAP_DB['comment_uname']}`='{$input['comment_uname']}',`{$MAP_DB['comment_title']}`='{$input['comment_title']}',`{$MAP_DB['comment_rate']}`='{$input['comment_rate']}',`{$MAP_DB['comment_msg']}`='{$input['comment_msg']}',`{$MAP_DB['comment_date']}`='{$input['comment_date']}'")
	or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
	return true;
}
function forums_comment_remove($in_id,$type){
	global $CONFIG,$MAP_DB;
	switch($type){
		case 0: 	$type='nnet_rid';break;
		case 1: 	$type='nnet_aid';break;
		case 2: 	$type='nnet_cid';break;
		default:	$type='nnet_rid';break;
	};
	mysql_query("DELETE FROM `{$CONFIG['sql_db']}`.`nnet_reviews` WHERE `$type`='$in_id'")
	or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
}
function forums_auto_insert($input){
	global $CONFIG,$MAP_DB,$INT_CONF;
	/* Available Input Variables
	$input['comment_id']	=addslashes(
	$input['comment_desc']	=addslashes(
	$input['category_id']	=addslashes(
	$input['comment_uid']	=addslashes(
	$input['comment_uname']	=addslashes(
	$input['comment_title']	=addslashes(
	$input['comment_rate']	=addslashes(
	$input['comment_msg']	=addslashes(
	$input['comment_date']	=addslashes( */
	if($INT_CONF["auto_insert_type"]==2){
		// LOOK FOR APPROPRIATE FORUM
		foreach($INT_CONF as $key => $value){
			if(preg_match("/^it_/",$key) && $value==$input['category_id']){
        			list($null,$TRUE_FID)=explode("_",$key);
			}
		}
		if($TRUE_FID!=''){
			$INT_CONF["auto_insertID"]=$TRUE_FID;
		} else {
			$INT_CONF["auto_insertID"]=$INT_CONF["auto_insert_default"];
		}
	}
if($INT_CONF["auto_insertID"]>0){
	if(strlen($input['comment_title'])>1){
		forum_sql_connect(1);
		$input['comment_desc'].="&nbsp;[}?m=show&id={$input['comment_id']}]details]";
		$result=mysql_query("INSERT INTO `{$INT_CONF['db']}`.`{$INT_CONF['prefix']}thread` SET `title`='{$input['comment_title']}',`lastpost`='{$input['comment_date']}',`nnet_aid`='{$input['comment_id']}',`forumid`='{$INT_CONF["auto_insertID"]}',`open`='1',`postusername`='{$input['comment_uname']}',`postuserid`='{$input['comment_uid']}',`lastposter`='{$input['comment_uname']}',`dateline`='{$input['comment_date']}',`visible`='1'")
			or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
		$data=mysql_fetch_row(mysql_query("SELECT LAST_INSERT_ID() FROM `{$INT_CONF['db']}`.`{$INT_CONF['prefix']}thread`"));
		mysql_free_result($result);
		
		mysql_query("INSERT INTO `{$INT_CONF['db']}`.`{$INT_CONF['prefix']}post` SET `threadid`='{$data[0]}',`username`='{$input['comment_uname']}',`userid`='{$input['comment_uid']}',`title`='{$input['comment_title']}',`nnet_aid`='{$input['comment_id']}',`pagetext`='{$input['comment_desc']}',`ipaddress`='".getenv("HTTP_REFERER")."',`allowsmilie`='1',`iconid`='1',`visible`='1',`dateline`='{$input['comment_date']}'")
		or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
	
		mysql_query("UPDATE `{$INT_CONF['db']}`.`{$INT_CONF['prefix']}forum` SET `threadcount`=`threadcount`+1 WHERE `forumid`='{$INT_CONF["auto_insertID"]}' LIMIT 1")
		or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error()); 
		forum_sql_connect(2);
	}
} // ends forum id check
}
function forums_thread_id($input){
	global $CONFIG,$MAP_DB,$INT_CONF;
	forum_sql_connect(1);
	extract(v45_sql_stripper(mysql_fetch_array(mysql_query("SELECT `threadid` FROM `{$INT_CONF['db']}`.`{$INT_CONF['prefix']}thread` WHERE `nnet_aid`='$input' LIMIT 1"),MYSQL_ASSOC)));
	forum_sql_connect(2);
	return $threadid;
}
function forums_comment_retrieve($input,$type,$start,$end){
	global $CONFIG,$MAP_DB,$INT_CONF;$tmp_array=array();
	forum_sql_connect(1);

	$type=($type==1)?'nnet_cid':'nnet_aid';
	if($INT_CONF["auto_insert"]==1){
		forum_sql_connect(1);
		$id_thread=forums_thread_id($input);
		$result=mysql_query("SELECT `postid` AS `comment_id`,`userid` AS `comment_uid`,`title` AS `comment_title`,`username` AS `comment_uname`,`pagetext` AS `comment_msg`,`dateline` AS `comment_date` FROM `{$INT_CONF['db']}`.`{$INT_CONF['prefix']}post` WHERE `threadid`='$id_thread' AND `nnet_aid`='' ORDER BY `postid` DESC LIMIT $start,$end;")
			or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
		while($data=mysql_fetch_array($result,MYSQL_ASSOC)){
			$data=v45_sql_stripper($data);
			$data['article_id']=$input;
			$tmp_array[]=$data;
		}
		mysql_free_result($result);
		forum_sql_connect(2);
	} else {
		$int_counter=0;
		$result=mysql_query("SELECT `nnet_rid` AS `comment_id`,
				`nnet_aid` AS `article_id`,
				`nnet_cid` AS `category_id`,
				`nnet_uid` AS `comment_uid`,
				`nnet_title` AS `comment_title`,
				`nnet_poster` AS `comment_uname`,
				`nnet_rate` AS `comment_rate`,
				`nnet_msg` AS `comment_msg`,
				`nnet_date` AS `comment_date` 
					FROM `{$CONFIG['sql_db']}`.`nnet_reviews`
					WHERE `$type`='$input' ORDER BY `nnet_rid` DESC LIMIT $start,$end;")
			or die("sMYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
		while($data=mysql_fetch_array($result,MYSQL_ASSOC)){
			$data=v45_sql_stripper($data);
			$tmp_array[$int_counter]=$data;
			$int_counter++;
		}
		mysql_free_result($result);
	}
	return $tmp_array;
}
function forums_comment_search($input,$field,$keywords,$start,$end){
	global $CONFIG,$MAP_DB;$tmp_array=array();
	$int_counter=0;$keywords=addslashes(stripslashes($keywords));
	$result=mysql_query("SELECT `nnet_rid` AS `comment_id`,`nnet_aid` AS `article_id`,`nnet_cid` AS `category_id`,`nnet_uid` AS `comment_uid`,`nnet_title` AS `comment_title`,`nnet_poster` AS `comment_uname`,`nnet_rate` AS `comment_rate`,`nnet_msg` AS `comment_msg`,`nnet_date` AS `comment_date` FROM `{$CONFIG['sql_db']}`.`nnet_reviews` WHERE `{$MAP_DB[$field]}` REGEXP '$keywords' ORDER BY `nnet_rid` DESC LIMIT $start,$end;")
		or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
	while($data=mysql_fetch_array($result,MYSQL_ASSOC)){
		$data=v45_sql_stripper($data);
		$tmp_array[$int_counter]=$data;
		$int_counter++;
	}
	mysql_free_result($result);
	return $tmp_array;
}
function forums_comment_total($input,$type){
	global $CONFIG,$MAP_DB;
	$type=($type==1)? 'nnet_cid' : 'nnet_aid';
	extract(v45_sql_stripper(mysql_fetch_array(mysql_query("SELECT COUNT(`nnet_rid`) AS `totalsize` FROM `{$CONFIG['sql_db']}`.`nnet_reviews` WHERE `$type`='$input'"),MYSQL_ASSOC)));
	return $totalsize;
}
function forums_comment_edit($input,$action){
	global $CONFIG,$MAP_DB;
	if($action=='r'){
		return (v45_sql_stripper(mysql_fetch_array(mysql_query("SELECT `nnet_rid` AS `comment_id`,`nnet_aid` AS `article_id`,`nnet_cid` AS `category_id`,`nnet_uid` AS `comment_uid`,`nnet_title` AS `comment_title`,`nnet_poster` AS `comment_uname`,`nnet_rate` AS `comment_rate`,`nnet_msg` AS `comment_msg`,`nnet_date` AS `comment_date` FROM `{$CONFIG['sql_db']}`.`nnet_reviews` WHERE `nnet_rid`='{$input}' LIMIT 1"),MYSQL_ASSOC)));
	} else {
		mysql_query("UPDATE `{$CONFIG['sql_db']}`.`nnet_reviews` SET `nnet_aid`='{$input['article_id']}',`nnet_cid`='{$input['category_id']}',`nnet_uid`='{$input['comment_uid']}',`net_title`='{$input['comment_title']}',`nnet_poster`='{$input['comment_uname']}',`nnet_rate`='{$input['comment_rate']}',`nnet_msg`='{$input['comment_msg']}',`nnet_date`='{NEPHP_CTIME}' WHERE `nnet_rid`='{$input['comment_id']}' LIMIT 1")
		or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
	}
}
function forums_login($input){
	global $gbl_env,$CONFIG,$INT_CONF,$access_hash,$_SERVER;
	forum_sql_connect(1);
	extract(v45_sql_stripper(mysql_fetch_array(mysql_query("SELECT `userid` AS `user_uid`,`styleid`,`lastactivity` FROM `{$INT_CONF['db']}`.`{$INT_CONF['prefix']}user` WHERE `username`='{$gbl_env['user_usr']}' AND `password`='".md5($gbl_env['user_pwd'])."' LIMIT 1"),MYSQL_ASSOC)));
	
	if($user_uid<1){
		printr("javascript:history.go(-1);","Invalid access combination. Please go back and try again....","{$CONFIG['dir_main']}/templates/common_redirect.html");
	}
	
	mysql_query("INSERT INTO `{$INT_CONF['db']}`.`{$INT_CONF['prefix']}session` SET `sessionhash`='$access_hash',`userid`='$user_uid',`host`='".getenv("HTTP_REFERER")."',`useragent`='".addslashes(stripslashes($_SERVER["HTTP_USER_AGENT"]))."',`lastactivity`='$lastactivity',`styleid`='$styleid'")
	or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
	forum_sql_connect(2);
	$int_long= time() + 30240000;
	setcookie('sessionhash',"$access_hash","$int_long",HTTP_COOKIE_PATH,HTTP_COOKIE_DOMAIN,HTTP_COOKIE_SECURE);
	setcookie('bbuserid',"$user_uid","$int_long",HTTP_COOKIE_PATH,HTTP_COOKIE_DOMAIN,HTTP_COOKIE_SECURE);
	setcookie('bbpassword',md5($gbl_env['user_pwd']),"$int_long",HTTP_COOKIE_PATH,HTTP_COOKIE_DOMAIN,HTTP_COOKIE_SECURE);
}
function forums_logout($input){
	global $HTTP_COOKIE_VARS,$INT_CONF;
	forum_sql_connect(1);
	mysql_query("DELETE FROM `{$INT_CONF['db']}`.`{$INT_CONF['prefix']}session` WHERE `sessionhash`='{$HTTP_COOKIE_VARS['sessionhash']}' LIMIT 1")
	or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
	
	$int_del = time()-31536001 ;
	///////////////////////////////////////////////////////////////////////////////////////////////
	// DELETE COOKIES HERE                                                                       //
	///////////////////////////////////////////////////////////////////////////////////////////////
	setcookie('sessionhash',"","$int_del",HTTP_COOKIE_PATH,HTTP_COOKIE_DOMAIN,HTTP_COOKIE_SECURE);
	setcookie('bbuserid',"","$int_del",HTTP_COOKIE_PATH,HTTP_COOKIE_DOMAIN,HTTP_COOKIE_SECURE);
	setcookie('bbpassword',"","$int_del",HTTP_COOKIE_PATH,HTTP_COOKIE_DOMAIN,HTTP_COOKIE_SECURE);
	setcookie('nephp4x',"","$int_del",HTTP_COOKIE_PATH,HTTP_COOKIE_DOMAIN,HTTP_COOKIE_SECURE);
	forum_sql_connect(2);
}
function forums_get_groups($db_info){
	global $HTTP_COOKIE_VARS,$INT_CONF;
	forum_sql_connect(1);
	$result=mysql_query("SELECT `usergroupid` AS `forum_group_id`,`title` AS `forum_group_title` FROM `$db_info`.`usergroup`")
	or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
	$tmp_array=array();

	while($data=mysql_fetch_array($result,MYSQL_ASSOC)){
		$data=v45_sql_stripper($data);
		$tmp_array[]=$data;
	}
	mysql_free_result($result);
	forum_sql_connect(2);
	return $tmp_array;
}
function forums_forums_fetch(){
	global $HTTP_COOKIE_VARS,$INT_CONF;
	forum_sql_connect(1);
	$result=mysql_query("SELECT `forumid`,`title` FROM `{$INT_CONF['db']}`.`{$INT_CONF['prefix']}forum` WHERE `allowposting`='1'")
		or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
	$tmp_hash=array();
	while($data=mysql_fetch_array($result,MYSQL_ASSOC)){
		$data=v45_sql_stripper($data);
		$tmp_hash[]=$data;
	}
	mysql_free_result($result);
	forum_sql_connect(2);
	return $tmp_hash;
}
function forum_db_setup($input=''){
	/////////////////////////////////////////////////////////////////////////////
	// ADD MORE FIELDS IF NECCESSARY                                           //
	/////////////////////////////////////////////////////////////////////////////
	global $CONFIG,$HTTP_COOKIE_VARS,$INT_CONF,$gbl_env,$NEPHP_IMG,$m_connect;
	forum_sql_connect(1);
        $result=mysql_query("ALTER TABLE `$input`.`user` ADD `user_favs` TEXT NOT NULL;");
	mysql_free_result($result);
	$result=mysql_query("ALTER TABLE `$input`.`user` ADD `user_cats` TEXT NOT NULL;");
	mysql_free_result($result);
	$result=mysql_query("ALTER TABLE `$input`.`post` ADD `nnet_aid` TEXT NOT NULL;");
	mysql_free_result($result);
	$result=mysql_query("ALTER TABLE `$input`.`thread` ADD `nnet_aid` TEXT NOT NULL;");
	mysql_free_result($result);
	forum_sql_connect(2);
}
function forum_review_simulator(){
	global $CONFIG,$HTTP_COOKIE_VARS,$INT_CONF,$gbl_env,$NEPHP_IMG;
	$id_thread=forums_thread_id($gbl_env['nnet_aid']);
	Header("Location: {$INT_CONF["forum_url"]}/newreply.php?action=newreply&threadid=$id_thread&preview=Preview%20Reply&title=".htmlspecialchars($gbl_env['comment_title'])."&message=".htmlspecialchars($gbl_env['comment_text']));
}
function forum_favs_update($input,$user_uid){
	global $CONFIG,$HTTP_COOKIE_VARS,$INT_CONF,$gbl_env,$NEPHP_IMG;
	forum_sql_connect(1);
	mysql_query("UPDATE `{$INT_CONF['db']}`.`{$INT_CONF['prefix']}user` SET `user_favs`='$input' WHERE `userid`='$user_uid'LIMIT 1")
	or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
	forum_sql_connect(2);
}
function forum_sql_connect($stage){
	global $CONFIG,$HTTP_COOKIE_VARS,$INT_CONF,$gbl_env,$NEPHP_IMG,$m_connect,$db;
	if($INT_CONF['db_user']!='' && $INT_CONF['db_user']!=$CONFIG['sql_username']){
		if($stage==1 && $CONNECTION_SWITCH != 1){ // establish connection
			$db->sql_disconnect();
			$db = new nephp();
			$db->sql_connect($CONFIG['sql_server'],$INT_CONF['db_user'],$INT_CONF['db_pass'],$CONFIG['sql_persistant'],'ERROR');
			$db->set_db($INT_CONF["db"]);
			$CONNECTION_SWITCH = 1;
		}
		if($stage==2){ // establish connection
			$db->sql_disconnect();
			$db = new nephp();
			$db->sql_connect($CONFIG['sql_server'],$CONFIG['sql_username'],$CONFIG['sql_password'],$CONFIG['sql_persistant'],'ERROR');
			$db->set_db($CONFIG['sql_db']);
			$CONNECTION_SWITCH = 0;
		}
	}
}
function forums_comment_latest($start,$end){
	global $CONFIG,$MAP_DB,$INT_CONF;$tmp_array=array();
	forum_sql_connect(1);
		$id_thread=forums_thread_id($input);
		$result=mysql_query("SELECT `postid` AS `comment_id`,`userid` AS `comment_uid`,`title` AS `comment_title`,`username` AS `comment_uname`,`pagetext` AS `comment_msg`,`dateline` AS `comment_date` FROM `{$INT_CONF['db']}`.`{$INT_CONF['prefix']}post` WHERE 1 ORDER BY `postid` DESC LIMIT $start,$end;")
			or die("MYSQL_QUERY ERROR NUMBER ".mysql_errno().": ".mysql_error());
		while($data=mysql_fetch_array($result,MYSQL_ASSOC)){
			$data=v45_sql_stripper($data);
			$data['article_id']=$input;
			$tmp_array[]=$data;
		}
		mysql_free_result($result);
		forum_sql_connect(2);
	return $tmp_array;
}
$var_test_pass=1;
$var_int_pass =1;

Quote:
Originally Posted by sebbe View Post
You will need to alter the query that fetches this info.

You need to show what's inside this file "forums_{$CONFIG["forum_integration"]}_func.php"
Reply With Quote
 


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 04:19 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.04212 seconds
  • Memory Usage 2,714KB
  • Queries Executed 12 (?)
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
  • (2)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (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)showthread_list
  • (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_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • 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_threaded
  • showthread_threaded_construct_link
  • 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