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
  #5  
Old 07-19-2005, 02:45 PM
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I added 3 posts back on july 16th and they automerged so might need to look up and refresh yourself if you read the post early.


Can someone tell me if I'm on the right track??
If want to add a brand new table with 8 fields via admincp?
Is this the query I (and my users) would run?
(check my syntax please)

Code:
CREATE TABLE `whodownloaded` (
	`downloadid` INT(15) NOT NULL AUTO_INCREMENT,
	`userid` INT(10) NOT NULL default '0',
	`username` VARCHAR(100) NOT NULL default '',
	`fileid` INT(10) NOT NULL default '0',
	`filename` VARCHAR(100) NOT NULL default '',
	`dateline` INT(10) NOT NULL default '',
	`ipaddress` VARCHAR(15) NOT NULL default '',
	`alt_ip` VARCHAR(15) NOT NULL default '',
PRIMARY KEY ( `downloadid` ) 
) TYPE = MYISAM;
I'm sure that isn't right as I never write anything right the first time.
I care about the users who are going to install this so I'd like it to be precise if someone can help me.

And then how does this look for my plugin to populate the tables as users download attachments??
Code:
<plugins>
	<plugin active="1">
		<title>Who Downloaded - Enable Logging</title>
		<hookname>attachment_complete</hookname>
		<phpcode><![CDATA[$whodl = array();
$whodl[userid] = $vbulletin->userinfo['userid'] ? $vbulletin->userinfo['userid'] : 0;
$whodl[username] = $vbulletin->userinfo['username'] ? $vbulletin->userinfo['username'] : '';
$whodl[fileid] = $vbulletin->input->clean_gpc('r', 'attachmentid', TYPE_UINT);
$whodl[filename] = $vbulletin->input->clean_gpc('r', 'filename', TYPE_STR);
$whodl[dateline] = TIMENOW;
$whodl[ipaddress] = $vbulletin->options['logip'] ? IPADDRESS : '';
$whodl[alt_ip] = $vbulletin->options['logip'] ? ALT_IP : '';

if ($whodl[userid] AND $whodl[fileid] AND $whodl[dateline])
{
	$db->query_write("
		INSERT INTO " . TABLE_PREFIX . "whodownloaded
			(userid,
			username,
			fileid,
			filename,
			dateline,
			ipaddress,
			alt_ip)
		VALUES
			($whodl[userid],
			$whodl[username],
			$whodl[fileid],
			$whodl[filename],
			$whodl[dateline],
			$whodl[ipaddress],
			$whodl[alt_ip])
	");
};]]></phpcode>
	</plugin>
</plugins>
You can see the variables I'm wanting to save.
Is this an effective way to do it?
And even if it's an "effective way" ... is there a "better way"??

No suggestion or idea is too little in my eyes.

There's screenshots of "my vision" posted way down at the end of my whodownloaded thread (in 350 extensions forum) if anyone is wondering why I'm trying to handle so many variables in that big php file I posted in earlier post.
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 09:12 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.08544 seconds
  • Memory Usage 2,729KB
  • 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
  • (7)bbcode_code
  • (4)bbcode_php
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (15)post_thanks_box
  • (15)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (15)post_thanks_postbit_info
  • (15)postbit
  • (15)postbit_onlinestatus
  • (15)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