Home → Admin Manual → Release Notes → Version 2 - Template Changes
62. Version 2 - Template Changes
This page describes the changes to each HelpSpot portal template. If you have an HTML editor available like Dreamweaver or BBEdit it is probably more efficient to simple use the diff tools to compare your edited documents (/custom_templates) with the new templates (/helpspot/templates/). If those tools are not available, the listings below will allow you to manually change the templates.
These changes are only needed if you have customized your portal and specifically customized the files listed below. If not, you do not need to make any adjustments.
Note: Your portal will not work correctly until these changes have been made.
These templates have changed in version 2:
- css.tpl.php
- forums.posts.tpl.php
- forums.topics.tpl.php
- header.tpl.php
- index.tpl.php
- request.tpl.php
- request.check.tpl.php
css.tpl.php
New line starting at 15:
header('Content-type: text/css'); header('Content-Disposition: inline; filename="style.css"'); ?> /* Import styles for calendar used in date/datetime custom fields */ @import "js/jscalendar/skins/aqua/theme.css"; body {
New line starting at 438:
} .captcha_label{ color: #000; font-size: 14px; border: 1px solid red; padding: 3px 10px 3px 10px; } .forumoption{
Remove line 41 in h2 class:
margin-bottom: -10px;
Remove line 60 in h4 class:
margin-bottom: -10px;
Remove line 138 in #content2col class delete the /20px:
font: 12px/20px Arial, Helvetica, sans-serif;
forums.posts.tpl.php
New line starting at 85:
<p><label for="sURL" class="datalabel"><?php echo lg_portal_posterurl ?>:</label><br /> <input type="text" name="sURL" size="40" maxlength="250" value="<?php echo $this->helper->visitor['url'] ?>" /> </p><?php //Captcha form protection. You can turn this on and off via a setting in Admin->Settings->System Security. It's enabled by default //This text captcha should be sufficient for most automated spam. If someone has modified a robot to target your site specifically //then obfuscating the word via javascript or using an image may improve results ?> <?php if($this->hd_useCaptcha == 1): ?> <p><label for="captcha" class="datalabel required"><?php echo lg_portal_captcha ?> - </label><b class="captcha_label"><?php echo $_SESSION['portal_captcha'] ?></b><br /> <?php echo $this->helper->showError('captcha','<br />') ?> <input type="text" name="captcha" size="20" maxlength="250" value="" /> </p> <?php endif; ?>
forums.topics.tpl.php
New line starting at 15:
<p><label for="sURL" class="datalabel"><?php echo lg_portal_posterurl ?>:</label><br /> <input type="text" name="sURL" size="40" maxlength="250" value="<?php echo $this->helper->visitor['url'] ?>" /> </p><?php //Captcha form protection. You can turn this on and off via a setting in Admin->Settings->System Security. It's enabled by default //This text captcha should be sufficient for most automated spam. If someone has modified a robot to target your site specifically //then obfuscating the word via javascript or using an image may improve results ?> <?php if($this->hd_useCaptcha == 1): ?> <p><label for="captcha" class="datalabel required"><?php echo lg_portal_captcha ?> - </label><b class="captcha_label"><?php echo $_SESSION['portal_captcha'] ?></b><br /> <?php echo $this->helper->showError('captcha','<br />') ?> <input type="text" name="captcha" size="20" maxlength="250" value="" /> </p> <?php endif; ?>
header.tpl.php
New lines starting at 19:
<link rel="stylesheet" type="text/css" href="<?php echo $this->cf_url ?>/index.php?pg=kb.wysiwyg" media="screen, projection" /> <!--javascript--> <script type="text/javascript" src="<?php echo $this->cf_url ?>/index.php?pg=js"></script> </head>
Modified line starting at 19 (line 23 after above edit), replace <body> with:
<body onload="<?php echo $this->pg_onload ?>">
index.tpl.php
New lines starting at 16:
case "css": include $this->loadTemplate('css.tpl.php'); break; case "js": include $this->loadTemplate('js.tpl.php'); break; case "kb": include $this->loadTemplate('kb.tpl.php'); break;
request.tpl.php
New lines starting at 22:
$this->assign('pg_title',lg_portal_request); //Set onload $this->assign('pg_onload', "ShowCategoryCustomFields();"); include $this->loadTemplate('header.tpl.php');
Modify line 106 (109 after above change), replace <select name="xCategory"> with:
<select name="xCategory" id="xCategory" onchange="ShowCategoryCustomFields();">
New lines starting at 123 (126 after above changes):
<?php $fieldID = 'Custom'.$field['fieldID']; //Set the field ID for use below ?>
<?php $visible = $field['isAlwaysVisible'] ? '' : 'display:none;'; //Set if the custom field is visible by default ?>
Modify line at 124 (128 after above changes), replace <p> with the code below. Be sure to leave the rest of the line the same from the <label> tag on.
<p id="<?php echo $fieldID ?>_wrapper" style="<?php echo $visible ?>"><label for="<?php echo $fieldID ?>" class="datalabel<?php echo $requiredClass ?>"><?php echo $field['fieldName'] ?>:</label><br />
New lines starting at 142 (146 after above changes):
<?php elseif($field['fieldType'] == 'numtext'): ?> <input name="<?php echo $fieldID ?>" type="text" size="10" maxlength="10" value="<?php echo $this->$fieldID ?>"> <?php elseif($field['fieldType'] == 'drilldown'): ?> <?php echo $this->helper->getDrillDownField($field,' '); ?> <?php elseif($field['fieldType'] == 'decimal'): ?> <input name="<?php echo $fieldID ?>" type="text" size="10" maxlength="10" value="<?php echo $this->$fieldID ?>"> <?php elseif($field['fieldType'] == 'regex'): ?> <?php echo $this->helper->getRegexField($field); ?> <?php elseif($field['fieldType'] == 'date'): ?> <?php echo $this->helper->getDateField($field); ?> <?php elseif($field['fieldType'] == 'datetime'): ?> <?php echo $this->helper->getDateTimeField($field); ?> <?php endif; ?>
New lines starting at 198:
<?php endif; ?> <?php //Captcha form protection. You can turn this on and off via a setting in Admin->Settings->System Security. It's enabled by default //This text captcha should be sufficient for most automated spam. If someone has modified a robot to target your site specifically //then obfuscating the word via javascript or using an image may improve results ?> <?php if($this->hd_useCaptcha == 1): ?> <p><label for="captcha" class="datalabel required"><?php echo lg_portal_captcha ?> - </label><b class="captcha_label"><?php echo $_SESSION['portal_captcha'] ?></b><br /> <?php echo $this->helper->showError('captcha','<br />') ?> <input type="text" name="captcha" size="20" maxlength="250" value="" /> </p> <?php endif; ?></div> <div class="formbuttondiv">
request.check.tpl.php
Modified lines starting at 72. Replace the entire block below with the one after:
<?php //Output public custom fields. ?> <?php foreach($this->splugin('CustomFields','getPublicCustomFields') AS $field): ?> <?php $fieldID = 'Custom'.$field['fieldID']; //Set the field ID for use below ?> <b><?php echo $field['fieldName'] ?>:</b> <?php if($field['fieldType'] == 'checkbox'): ?> <?php echo ($request[$fieldID] == 1 ? lg_portal_checkboxchecked : lg_portal_checkboxempty) ?><br /> <?php else: ?> <?php echo (empty($request[$fieldID]) ? ' - ' : $request[$fieldID]) ?><br /> <?php endif; ?> <?php endforeach; ?> <br />
New code:
<?php //Output public custom fields. ?> <?php foreach($this->splugin('CustomFields','getPublicCustomFields') AS $field): ?> <?php $fieldID = 'Custom'.$field['fieldID']; //Set the field ID for use below ?> <?php $visible = $field['isAlwaysVisible'] ? '' : 'display:none;'; //Set if the custom field is visible by default ?> <div id="<?php echo $fieldID ?>_wrapper" style="<?php echo $visible ?>"> <b><?php echo $field['fieldName'] ?>:</b> <?php if($field['fieldType'] == 'checkbox'): ?> <?php echo ($request[$fieldID] == 1 ? lg_portal_checkboxchecked : lg_portal_checkboxempty) ?> <?php elseif($field['fieldType'] == 'drilldown'): ?> <?php echo $this->helper->showDrillDownField($request[$fieldID]); ?> <?php elseif($field['fieldType'] == 'date'): ?> <?php echo $this->helper->shortDateFormat($request[$fieldID]) ?> <?php elseif($field['fieldType'] == 'datetime'): ?> <?php echo $this->helper->longDateFormat($request[$fieldID]) ?> <?php else: ?> <?php echo (empty($request[$fieldID]) ? ' - ' : $request[$fieldID]) ?> <?php endif; ?> </div> <?php endforeach; ?> <!-- You must uncomment this line if you want to show custom fields --> <script type="text/javascript" language="JavaScript">ShowCategoryCustomFields(<?php echo $request['xCategory'] ?>);</script> <br />