Quote:
Originally Posted by RS_Jelle
That's not a bug. You enabled a debugging option.
Settings -> General Settings -> Add Template Name in HTML Comments -> No
|
I disagree. I have a need from time to time to turn on HTML comments to find a template issue. Both vBulletin and every other add-on I have behaves nicely with the HTML Comments turned on, except downloadsii. I consider this a bug.
For those who would like to fix it, here's a simple fix.
Find the plugin named "DownloadsII: Create Thread on Add".
Partway down, you will see some code that uses vbulletin templates to build the message that will be posted. Like this:
PHP Code:
$templater = vB_Template::create('downloadii_create_newthread');
$templater->register('id', $id);
$templater->register('dtitle', $dtitle);
$templater->register('ddesc', $ddesc);
$pagetext .= $templater->render();
// VB3 eval('$title .= "' . fetch_template('downloadii_create_newthread_title') . '";');
$templater = vB_Template::create('downloadii_create_newthread_title');
$templater->register('dtitle', $dtitle);
$title .= $templater->render();
This takes the raw templates (including the html comments if you have the debugging turned on) to use for the message. Edit the above code like this:
PHP Code:
$templater = vB_Template::create('downloadii_create_newthread');
$templater->register('id', $id);
$templater->register('dtitle', $dtitle);
$templater->register('ddesc', $ddesc);
$pagetext .= $templater->render();
$pagetext = preg_replace('/<!--(.*)-->/Uis', '', $pagetext);
// VB3 eval('$title .= "' . fetch_template('downloadii_create_newthread_title') . '";');
$templater = vB_Template::create('downloadii_create_newthread_title');
$templater->register('dtitle', $dtitle);
$title .= $templater->render();
$title = preg_replace('/<!--(.*)-->/Uis', '', $title);
All I did was add a line after the template was evaluated to strip all HTML comments from what was rendered, once for the message and once for the title. These 2 SMALL edits are all that are needed to make this plugin play nice with the html comments debugging set to on.