The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#5
|
|||
|
|||
![]()
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 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> 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. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|