The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
add plug-in, can't submit
Hello,
I have a plug-in: Code:
if ($vbulletin->options['enable'] AND (THIS_SCRIPT=='newthread')) { if (in_array($forumid, explode(",", $vbulletin->options[enable_forumid']))) { $getinfos = $vbulletin->db->query_read(" SELECT postuserid, threadid, postdate FROM " . TABLE_PREFIX . "testting WHERE postuserid = " . $vbulletin->userinfo['userid'] . " GROUP BY threadid ORDER BY threadid ASC "); $count = $vbulletin->db->num_rows($getinfos); if ($count = 0) { $mytest = '<option value="0" selected="selected">0</option>'; while ($getinfo = $vbulletin->db->fetch_array($get_infos)) { $mytest = '<option value="' . $getinfo[threadid] . '">'. $getinfo[threadid] . '</option>'; } } } } Thank This is video: http://www.youtube.com/watch?v=sNtKvZ90Ews |
#2
|
|||
|
|||
You have a few typos in there. Try this:
Code:
if ($vbulletin->options['enable'] AND (THIS_SCRIPT=='newthread')) { if (in_array($forumid, explode(",", $vbulletin->options['enable_forumid']))) { $getinfos = $vbulletin->db->query_read(" SELECT postuserid, threadid, postdate FROM " . TABLE_PREFIX . "testting WHERE postuserid = " . $vbulletin->userinfo['userid'] . " GROUP BY threadid ORDER BY threadid ASC "); $count = $vbulletin->db->num_rows($getinfos); if ($count > 0) { $mytest = '<option value="0" selected="selected">0</option>'; while ($getinfo = $vbulletin->db->fetch_array($get_infos)) { $mytest = '<option value="' . $getinfo[threadid] . '">'. $getinfo[threadid] . '</option>'; } } $templater = vB_Template::create('test_newthread'); $templater->register('mytest', $mytest); $out .= $templater->render(); $vbulletin->templatecache['newthread'] = str_replace('\'' . $messagearea . '\'', '<div class="blockrow">' . $out . '</div>\'' . $messagearea . '\'', $vbulletin->templatecache['newthread']); } } |
#3
|
|||
|
|||
Now that I look at it again, I might have messed up your str_replace() line, you probably had it right.
|
#4
|
|||
|
|||
|
#5
|
|||
|
|||
And that problem goes away if you disable your plugin? It must be another problem with the plugin (I guess that's obvious ). I notice on the first line you have this:
Code:
if ($vbulletin->options['enable'] AND (THIS_SCRIPT=='newthread')) shouldn't it be 'enable_forumid'? Edit: also, is your table named "testting"? |
#6
|
||||
|
||||
Don't you want it to be like this?
PHP Code:
|
Благодарность от: | ||
kh99 |
#7
|
|||
|
|||
Quote:
Code:
if ($vbulletin->options['enable'] AND (THIS_SCRIPT=='newthread')) if ($vbulletin->options['enable'] = if enable THIS_SCRIPT=='newthread' = show only new thread |
#8
|
|||
|
|||
OK, if your enable/disable option varname is 'enable', that's fine. ETA: but normally you'd want to choose something less common (like adding a unique prefix), because if everyone just used "enable" you wouldn't be able to install more than one mod without a conflict. But I don't see how that could cause your problem, even if there was a comflict.
|
#9
|
|||
|
|||
this is my templater
Code:
<vb:if condition="$show['member'] AND $vboptions['enable']"> <form name="threadid" action="javascript:get(this.parentNode);" id="threadid" method="post"> <input type="hidden" id="s" name="s" value="{vb:raw session.sessionhash}" /> <input type="hidden" id="securitytoken" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" /> <div>Select ThreadID To Post: <select id="threadid" name="threadid" onChange="javascript:get(this.parentNode);"> <option value="0" selected="selected">0</option> {vb:raw mytest} </select> </div> <div id="threadid"></div> </form> </vb:if> |
#10
|
||||
|
||||
Any way we can actually see the results of your plugin on a page?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|