HomeAdmin ManualRelease NotesVersion 2.4.2 - Template Changes

59. Version 2.4.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.

Your portal will not work correctly until these changes have been made.

Note: If you're upgrading from version 1.x you will also need to apply the template changes here.

These templates have changed in version 2.4:

css.tpl.php

New lines starting at 502:

pre{ font: 100% courier,monospace; border: 1px solid #ccc; overflow: auto; overflow-x: scroll; width: 90%; padding: 1em 1em 1em 1em; background: #fff7f0; color: #000 }
.initsubject{ color: #7F7F7F; } .request_summary{ display: block; overflow: hidden; height: 14px; } .feedback_box_error{ border: 1px solid red; padding: 10px; color: red; font-weight: bold; } .feedback_box_positive{ border: 1px solid green; padding: 10px; color: green; font-weight: bold; } .calendar_date_table{ padding-left: 0px; margin-left: 0px; margin-top: 2px; margin-bottom: 0px; padding-bottom: 0px; } .calendar_date{ text-align: bottom; border: 1px solid #666666; background-color: #fff; padding: 2px; } .calendar_date_holder{ color: #666666; cursor: pointer; } .sending_note{ color: red; }

email.tpl.php

Modified line 20, change form URL. Line should be:

<form action="index.php?pg=email&id=<?php echo $this->get_id ?>" method="POST">

New lines starting at 41:

<p><label for="youremail" class="datalabel"><?php echo lg_portal_youremail ?></label><br> <input type="text" name="youremail" size="40" maxlength="250" value="<?php echo $this->helper->visitor['email'] ?>" /> </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; ?>
<div class="formbuttondiv">

index.tpl.php

New lines starting at 11:

case "request.check":
// If a visitor is logged in already send them to their history if($this->splugin('Request_Check','isLoggedIn') && empty($this->get_id)){ $this->helper->redirect($this->cf_url.'/index.php?pg=request.history'); }
include $this->loadTemplate('request.check.tpl.php'); break;

New lines starting at 18:

break;
case "request.history": include $this->loadTemplate('request.history.tpl.php'); break;
case "css":

New lines starting at 71:

		
break;
case "maintenance": include $this->loadTemplate('maintenance.tpl.php'); break;
default:

js.tpl.php

Modified line 12, added text to header. Line should be:

header('Content-type: text/javascript; charset=utf-8');
header('Content-Disposition: inline; filename="js.js"');

New lines starting at 58 (bottom of file):

}
//Function that resets a portal login password function ChangePortalLoginPassword(){ //Find the new password they've set var password_new = $F('new_password'); //Find the password confirmation they've set var password_confirm = $F('new_password_confirm'); //Check if the password and the password confirm field match and that the password is not empty. if(password_new != password_confirm || password_new.empty()){ //Popup an alert to notify the user that the passwords must match show_feedback("<?php echo lg_portal_req_passworderror ?>","error"); }else{ //Everything is OK so send the new password to the server new Ajax.Request("index.php?pg=password.change", { method: "post", parameters: {password: password_new}, onSuccess: function(transport) { show_feedback("<?php echo lg_portal_req_passwordsaved ?>","success"); //Hide the password box and clear the form fields $("change_password_box").hide(); $("new_password").value = ""; $("new_password_confirm").value = ""; }, onFailure: function(transport){ show_feedback("<?php echo lg_portal_req_passwordposterror ?>","error"); } }); } } //Function that sends the retrieve password email function RetrievePortalLoginPassword(){ //If there's no email in the box show feedback that an email needs to be entered if($F("login_email").empty()){ show_feedback("<?php echo lg_portal_req_emailempty ?>","error"); return; }else{ //Change link text to loading $("retrievePortalPasswordLink").update('<span class="sending_note"><?php echo lg_portal_req_sending ?></span>'); //An email is available so send the password email new Ajax.Request("index.php?pg=password.retrieve", { method: "post", parameters: {login_email: $F("login_email")}, onSuccess: function(transport) { show_feedback("<?php echo lg_portal_req_passwordsent ?>","success"); }, onFailure: function(transport){ show_feedback("<?php echo lg_portal_req_emailerror ?>","error"); }, onComplete: function(){ //Remove sending text $("retrievePortalPasswordLink").update(); } }); } } //Function to create a feedback box at the top of the right column. function show_feedback(message,type){ //Style the feedback box as appropriate for each type of feedback if(type == "error"){ $("feedback_box").addClassName("feedback_box_error"); }else{ //By default shows positive feedback $("feedback_box").addClassName("feedback_box_positive"); } //Show the box $("feedback_box").show(); //Insert message into the feedback box $("feedback_box").update(message); }

navigation.tpl.php

New lines starting at 46 (bottom of file):

<div id="content2col">
<!-- Feedback box. Hidden by default and called from Javascript functions to provide user feedback --> <div id="feedback_box" style="display:none;"></div>

request.check.tpl.php

New lines starting at 11:

	
<h1><?php echo lg_portal_accessidheader ?> : <?php echo $this->get_id ?></h1>
<?php include $this->loadTemplate('loginbar.tpl.php'); ?>
<br />

Modified lines starting at 26. Replace the entire block below with the one after:

Old Code:

<?php /* Because the updates are only protected by the access key this code hides the request information after the request has been closed for X days. This keeps people from submitting information about a new request into an old one and also prevents search engines from getting this private information if the URL is accidentally published. You may change the time after the request is closed through the last variable below. Other valid examples are: '2 week', '1 month', '15 day'. Empty will turn off access as soon as the request is closed '' Leaving some time is also good because if the customers issue wasn't in fact solved then it gives them time to provide more information. In that case HelpSpot will reopen the request back to the original person assigned rather than the customer submitting a new request about an existing issue and the back and forth that results from that scenario. */ ?> <?php if($this->splugin('Request_Check','isClosed',$this->get_id,'2 Day')): ?>

New Code:

		<?php 
		/* This code hides the 
			request information after the request has been closed for X days. This keeps
			people from submitting information about a new request into an old one and also 
			prevents search engines from getting this private information if the URL is accidentally 
			published. You may change the time after the request is closed through the last variable below.
			Other valid examples are: '2 week', '1 month', '15 day'. Empty will turn off access as soon as the request is closed ''
			
			Leaving some time is also good because if the customers issue wasn't in fact solved then it gives them time to 
			provide more information. In that case HelpSpot will reopen the request back to the original person assigned 
			rather than the customer submitting a new request about an existing issue and the back and forth that results
			from that scenario.
			
			Note that as of version 2.4 this line also checks to see if the customer is logged in. If they are they are allowed 
			to view the request even if the time specified below has passed.
		*/ ?>
		<?php if($this->splugin('Request_Check','isClosed',$this->get_id,'2 Day') && !$this->splugin('Request_Check','isLoggedIn')): ?>

Modified line 43. Replace the entire line with the one after:

Old Code:

			
<p><a href="index.php?pg=request"><?php echo lg_portal_closedsubmitnew ?></a></p>

New Code:

			<p>
				<a href="index.php?pg=request.check"><?php echo lg_portal_closedlogin ?></a>
				<?php echo lg_portal_closedor ?>
				<a href="index.php?pg=request"><?php echo lg_portal_closedsubmitnew ?></a>
			</p>

New lines starting at 119:

<?php endforeach; ?>
<?php //Don't show update box for requests closed longer than 2 days ?> <?php if(!$this->splugin('Request_Check','isClosed',$this->get_id,'2 Day')): ?>
<p><label for="update" class="datalabel"><?php echo lg_portal_req_update ?>:</label><br />

New lines starting around 134:

<div class="formbuttondiv"> <input type="submit" name="submit" value="<?php echo lg_portal_req_updaterequest ?>" /> </div>
<?php endif; ?>
<?php endif; ?> <?php else: ?>

Modified line 149. Replace the entire block below with the one after:

Old Code:

<?php else: ?> <form action="index.php?pg=request.check" method="get"> <input type="hidden" name="pg" value="request.check" /> <p><?php echo $this->helper->showError('id','<br />') ?> <b><?php echo lg_portal_req_enterkey ?>:</b> <input type="text" name="id" value="" size="20" maxlength="100" /> <input type="submit" name="submit" value="<?php echo lg_portal_check ?>" /> </p> </form> <?php endif; ?>
<?php include $this->loadTemplate('footer.tpl.php'); ?>

New Code:

<?php else: ?>

	<form action="index.php?pg=request.check" method="get">
		<input type="hidden" name="pg" value="request.check" />
		<p><?php echo $this->helper->showError('id','<br />') ?>
			<b><?php echo lg_portal_req_enterkey ?>:</b><br /><br />
			<input type="text" name="id" value="" size="20" maxlength="100" tabindex="100" />
			<input type="submit" name="submit" value="<?php echo lg_portal_check ?>" tabindex="101" />
		</p>
	</form>
	
	<hr width="80%" />
	
	<form action="index.php?pg=login" method="post">
		<p><b><?php echo lg_portal_req_login ?>:</b></p>
		
		<p><label for="login_email" class="datalabel"><?php echo ($this->hd_requestCheckAuthType == "internal" ? lg_portal_req_loginemail : lg_portal_req_loginusername) ?>:</label><br />
			<?php echo $this->helper->showError('login_email','<br />') ?>
			<input type="text" name="login_email" id="login_email" size="40" maxlength="100" tabindex="102" value="<?php echo $this->get_login_email ?>" autocomplete="off" /><br />
			<?php if($this->hd_requestCheckAuthType == "internal"): ?>
			<?php //only show this password retrieval link if we're using internal authentication on the portal ?>
				<span id="retrievePortalPasswordLink">(<a href="#" onclick="RetrievePortalLoginPassword();return false;"><?php echo lg_portal_req_emailpassword ?></a>)</span>
			<?php endif; ?>
		</p>		

		<p><label for="login_password" class="datalabel"><?php echo lg_portal_req_loginpassword ?>:</label><br />
			<input type="password" name="login_password" id="login_password" size="40" maxlength="100" tabindex="103" value="" autocomplete="off" />
		</p>
		
		<p>
			<input type="submit" name="submit" value="<?php echo lg_portal_req_loginbutton ?>" tabindex="104" />
		</p>
	</form>
	
<?php endif; ?>
	
<?php include $this->loadTemplate('footer.tpl.php'); ?>

request.tpl.php

Modified line 206, change input size. Line should be:

	
<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="15" maxlength="250" value="" />
</p>

searchbox.tpl.php

Modified entire file. Replace all lines in searchbox.tpl.php with:

<?php if($this->splugin('Forums_Forums','count') || $this->splugin('KB_Books','count')): ?>
	<form action="index.php" method="get">
	<input type="hidden" name="pg" value="search">
	<div class="">
		<p align="center">
			<input type="text" name="q" size="40" style="width:60%;" value="<?php echo $this->get_q ?>"> 
			<select name="area" id="area" style="width: 25%;">				
				<?php if($this->splugin('KB_Books','count')): ?>
					<option value="kb" <?php if($this->get_area == 'kb') echo 'selected' ?>><?php echo lg_portal_searchkb ?></option>
				<?php endif; ?>
				<?php if($this->splugin('Forums_Forums','count')): ?>
					<option value="forum" <?php if($this->get_area == 'forum') echo 'selected' ?>><?php echo lg_portal_searchforum ?></option>
				<?php endif; ?>
			</select>	
			<input type="submit" name="submit" value="<?php echo lg_portal_search ?>">
		</p>
	</div>
	</form>
<?php endif; ?>

This page was: Helpful | Not Helpful