Guide Category

134

Upgrade Theme 9.2 to 9.5

Upgrade Datalife Engine theme from 9.2 to 9.5 is our upgrade guide project to help users upgrade the theme in single tutorial without having to worry about 9.3 and 9.4 upgrade process, this tutorial will cover the theme upgrade in versions 9.3, 9.4 and 9.5. Usually when you upgrade Datalife Engine from version 9.2 to 9.5 you have to upgrade theme from 9.2 to 9.3, then upgrade 9.3 to 9.4 and then upgrade 9.4 to 9.5, our all in one tutorial series will make it easy for you so that you can easily upgrade theme for 9.2 to 9.5 step by step in single tutorial.
dlestarter
Upgrade Theme 9.2 to 9.5
Upgrade Theme
9.2 to 9.5
Last Updated: November 20, 2013
Upgrade Datalife Engine theme from 9.2 to 9.5 is our upgrade guide project to help users upgrade the theme in single tutorial without having to worry about 9.3 and 9.4 upgrade process, this tutorial will cover the theme upgrade in versions 9.3, 9.4 and 9.5. Usually when you upgrade Datalife Engine from version 9.2 to 9.5 you have to upgrade theme from 9.2 to 9.3, then upgrade 9.3 to 9.4 and then upgrade 9.4 to 9.5, our all in one tutorial series will make it easy for you so that you can easily upgrade theme for 9.2 to 9.5 step by step in single tutorial.

Files to change:

  1. addcomments.tpl (add tag question/answer)
  2. addnews.tpl (add tag question/answer)
  3. comments.tpl (Change and add editor style)
  4. fullstory.tpl (add topnews list style)
  5. login.tpl (add tag do not remember me option)
  6. pm.tpl (add google reCaptcha)
  7. profile_popup.tpl (add tag subscribe to user RSS feed and change tags)
  8. registration.tpl (add tag question/answer)
  9. userinfo.tpl (add ignore list and change tags)
  10. preview.css (add pre code style)
  11. /style/engine.css (add pre code style)
  12. .htaccess (change structure for template protection)

Files to add:

  1. frame.css (popup windows page)
  2. print.tpl (articles print page)
  3. relatednews.tpl (additional files for related news module)
  4. static_print.tpl (static print page)
  5. topnews.tpl (additional files for top news module)
  6. dleimages/delete.png
  7. dleimages/no_image.jpg
  8. dleimages/videopreview.jpg
  9. dleimages/youtubepreview.jpg
  10. images/complaint.png

Files to change

1) Open addcomments.tpl

Find

[sec_code]

Add before

[question]
<tr>
<td class="label">Question:</td>
<td><div>{question}</div></td>
</tr>
<tr>
<td class="label">Answer:<span class="impot">*</span></td>
<td><div><input type="text" name="question_answer" id="question_answer" class="f_input" /></div></td>
</tr>
[/question]
2) Open addnews.tpl

Add the following code on the beginning of the file:

<link rel="stylesheet" type="text/css" href="engine/skins/chosen/chosen.css"/>
<script type="text/javascript" src="engine/skins/chosen/chosen.js"></script>
<script type="text/javascript">
$(function(){
	$('#category').chosen({allow_single_deselect:true, no_results_text: 'No category found or not selected'});
});
</script>

Find

[sec_code]

Add before

[question]
<tr>
<td class="label">Question:</td>
<td><div>{question}</div></td>
</tr>
<tr>
<td class="label">Answer:<span class="impot">*</span></td>
<td><div><input type="text" name="question_answer" class="f_input" /></div></td>
</tr>
[/question]
3) Open comments.tpl

Find

<li>[com-edit]Edit[/com-edit]</li>

Add before

<li>[complaint]Report Abuse[/complaint]</li>
The theme design will be different, but the point to modify this file is to add complaint module button to report inappropriate comments to the site administrator, you can use your own languages, image or icon that suite to your theme design but you must keep the tags [complaint] and [/complaint] for the link to click for report
4) Open fullstory.tpl

Find

<li>{favorites}</li>

Add after

<li>[complaint]<img src="{THEME}/images/complaint.png" title="Report Error" alt="Report Error" />[/complaint]</li>
The theme design will be different, but the point to modify this file is to add complaint module button to report inappropriate comments to the site administrator, you can use your own languages, image or icon (DLE also provide icon for the function, please download it below) that suite to your theme design but you must keep the tags [complaint] and [/complaint] for the link to click for report
Start: Skip this step if you are not using "Default" theme

Find

<a class="addcombtn" href="javascript:ShowOrHide('addcform')">

Replace with

<a class="addcombtn" href="#" onclick="$('#addcform') .toggle();return false;">
End: Skip this step if you are not using "Default" theme
5) Open login.tpl

Find

<label for="login_name">Name:</label><input type="text" name="login_name" id="login_name" />

Replace with

<label for="login_name">{login-method}</label><input type="text" name="login_name" id="login_name" />

Note: the theme design maybe vary, so don't worry if you can't find the code above, this upgrade instruction is base on the "Default" theme that comes with script, so if you are not using Default theme then please note this option is for "Login" method, the tag is only to let your site members know that which method your website is setting to login by using "Username" or "E-mail", so the exactly purpose of tag {login-method} is to switch between method text, so if you have special design on your theme, you just need to put the text to tell your members which method you use for login in your website, so that you don't have to put the tag {login-method} in your theme, for example www.dlestarter.com is using email login method and we use icon for login input, so we just use email icon and text to tell our members that we use email login, not username...so that's good example.

Find

<li class="lbtn"><button class="fbutton" onclick="submit();" type="submit" title="Login"><span>Login</span></button></li>

Add before

<li class="lfield lfchek"><input type="checkbox" name="login_not_save" id="login_not_save" value="1"/><label for="login_not_save"> Do not remember me</label></li>
Note: the theme design maybe vary, so don't worry if you can't find the code above, this upgrade instruction is base on the "Default" theme that comes with script, so if you are not using Default theme then please note this option is for "Login" cookie either to save cookie or not saving cookie on the local computer you are using to login to your website, the tag input ID "login_not_save" is to give the option for you and your members the option for "Do not save me" if this option is check when you and your members login to your site, the cookie session for your site login will not be be saved on that computer, this option is very helpful if you and your members using ublic computers or friends' computers. The code can be placed anywhere within a login form in login.tpl file, the only require tags are:
<input type="checkbox" name="login_not_save" id="login_not_save" value="1" />
And text for checkbox label:
Do not remember me
So you can apply them to your own design theme without having to worry some tags and code maybe missing like I said above, the theme designs are different from Default theme...!
6) Open pm.tpl

Find

<li>[del]Delete[/del]</li>

Add before

<li>[complaint]Report Abuse[/complaint]</li>
<li>[ignore]Add Sender to my block list[/ignore]</li>
The theme design will be different, but the point to modify this file is to add complaint module button to report abusive users and spammers to the site administrator, you can use your own languages, image or icon that suite to your theme design but you must keep the tags - [complaint] and [/complaint] for the link to click for report.
- [ignore] and [/ignore] for the link adding the sender to the ignore list or black list.
7) Open profile_popup.tpl

Find

{news_num} [ {news} ]

Add after

[rss]<img src="{THEME}/images/rss.png" alt="rss" style="vertical-align: middle; margin-left: 5px;" />[/rss]

Find

{news_num}

Replace with

{news_num}

Find

{comm_num}

Replace with

{comm-num}
8) Open registration.tpl

Find

[sec_code]

Find

[question]
<tr>
<td class="label">Question:</td>
<td><div>{question}</div></td>
</tr>
<tr>
<td class="label">Answer:<span class="impot">*</span></td>
<td><div><input type="text" name="question_answer" class="f_input" /></div></td>
</tr>
[/question]
9) Open userinfo.tpl

Find

{news_num}

Replace with

{news_num}

Find

{comm_num}

Replace with

{comm-num}

Find

			<tr>
				<td class="label">Location:</td>
				<td><input type="text" name="land" value="{land}" class="f_input" /></td>
			</tr>

Add after

			<tr>
				<td class="label">My Black list:</td>
				<td>{ignore-list}</td>
			</tr>
The theme design will be different, but the point to modify this file is to add ignore list in user profile also known as "Black List" or "Block List", this option requires for block/black/ignore list management, each user will have their own list and they can manage the list to remove the users from the list. You can use your own languages, image or icon that suite to your theme design but you must keep the tags {ignore-list} for the list of users who have been added to the list so the members can manage them
10/11) Open the file /style/engine.css and preview.css

Add the following code at the end:

/*--- Code tag highlight [ code ]---*/
pre code {
  display: block; padding: 0.5em;
  background: #f9fafa; 
  border: 1px solid #dce7e7;
  overflow:auto;
  white-space: pre;
}
pre .comment,
pre .template_comment,
pre .diff .header,
pre .doctype,
pre .lisp .string,
pre .javadoc {
  color: #93a1a1;
  font-style: italic;
}
pre .keyword,
pre .css .rule .keyword,
pre .winutils,
pre .javascript .title,
pre .method,
pre .addition,
pre .css .tag,
pre .lisp .title {
  color: #859900;
}
pre .number,
pre .command,
pre .string,
pre .tag .value,
pre .phpdoc,
pre .tex .formula,
pre .regexp,
pre .hexcolor {
  color: #2aa198;
}
pre .title,
pre .localvars,
pre .function .title,
pre .chunk,
pre .decorator,
pre .builtin,
pre .built_in,
pre .lisp .title,
pre .identifier,
pre .title .keymethods,
pre .id {
  color: #268bd2;
}
pre .tag .title,
pre .rules .property,
pre .django .tag .keyword {
  font-weight: bold;
}
pre .attribute,
pre .variable,
pre .instancevar,
pre .lisp .body,
pre .smalltalk .number,
pre .constant,
pre .class .title,
pre .parent,
pre .haskell .label {
  color: #b58900;
}
pre .preprocessor,
pre .pi,
pre .shebang,
pre .symbol,
pre .diff .change,
pre .special,
pre .keymethods,
pre .attr_selector,
pre .important,
pre .subst,
pre .cdata {
  color: #cb4b16;
}
pre .deletion {
  color: #dc322f;
}
pre .tex .formula {
  background: #eee8d5;
}
Different theme designs are different, some of theme use /style/engine.css, some use /styles/engine.css, some use /css/engine.css, some don't use engine.css file but use different name or file, but the point is to add this tag within the theme anywhere in css file
12) open the {THEME}/.htaccess
The .htaccess file in your "templates/your_theme" folder and replace all the code inside the file with the following contents:

htaccess

Order allow,deny
Deny from all
<FilesMatch ".(css)$|^$">
   Order deny,allow
   Allow from all
</FilesMatch>
For example if you are using theme "WStarter" then the file /templates/WStarter/.htaccess must contain the code above

Files to add (Download from attached file)

Please download the attached file and place them within folder /templates/YOUR THEME/
The following files are included in the package (You can use your own images if you like)
  1. frame.css (popup windows page)
  2. print.tpl (articles print page)
  3. relatednews.tpl (additional files for related news module)
  4. static_print.tpl (static print page)
  5. topnews.tpl (additional files for top news module)
  6. dleimages/delete.png
  7. dleimages/no_image.jpg
  8. dleimages/videopreview.jpg
  9. dleimages/youtubepreview.jpg
  10. images/complaint.png
  1. relatednews.tpl: this file is used for tag {related-news} for related news in fullstory.tpl, the purpose of this file to be added independently because Datalife Engine have added and improve the new way to display related news, they have added some tags that are very helpful for those who want to customize the way related news to display, now you can use additional tags to display images and text from the article for additional enhanced look...the following tags are applied within the file relatednews.tpl:
    • {image-X}: This will display the image you have uploaded and added in the article, the X indicates the image number, if you add only 1 image then the tag will be {image-1}, if you have added more than 1 image, you can specify the image number like {image-2}, {image-3} and so on...the tag only identify the image name, but it will not give you the full html code, so you must manually input the proper img code like:

      Example:

      <img src="{image-1}" alt="" width="xxx" height="xxx" />
      <img src="{image-2}" alt="" width="xxx" height="xxx" />
      <img src="{image-3}" alt="" width="xxx" height="xxx" />
      
    • {text limit="XXX"}: This will display the short story description as additional details than title, the older version you can only use title for related news unless you use some hacks to get anything else display, now you add additional text description, the XXX indicates how many letters and characters you want the short description to display, if the max text has reach the number you specified then it will be cut out the rest of shortstory automatically. Please note that the tag {text limit="xxx"} will only grab everything in regular text format, it will not grab any styles, bbcode styles or html code styles
    • New in 9.5, you can now use all xfields in your topnews and related news, for example:

      Example:

      <img src="[xfvalue_poster]" alt="" width="xxx" height="xxx" />
      
  2. topnews.tpl This file is used for the tag "{topnews}" in either main.tpl or sidebar.tpl (depending on design), the purpose of this file and the additional tags are exactly the same as relatednews.tpl above, you can use tags {image-X} and {text limit="XXX"}, you can also use xfield as same as relatednews.tpl, so please refer to the details above the additional tags
Both files are using the default tag

Example Code:

<li><a href="{link}">{title}</a></li>
  • {link}: is the full link url for the article, it will automatically converted to any link formats of your SEO settings or none SEO
  • {title}: is the actual article title

Additional Tags for DLE 9.5 in user profile:

There are a few tags added in 9.5 but we don't seem to find the information anywhere, even the themes come with the DLE 9.5 package don't even add these tags in the themes so this information you can only find in DLEStarter.com!...
The following tags are applied to template files userinfo.tpl and comments.tpl
  1. [fullname]xxx[/fullname] is used for open and close tag if full name field {fullname} was input, for example, in templates/Default/userinfo.tpl, find:

    Find:

    <li><span class="grey">Full name:</span> <b>{fullname}</b></li>
    

    Replace with:

    [fullname]<li><span class="grey">Full name:</span> <b>{fullname}</b></li>[/fullname]
    
    If the user input the information in Full name filed then it will show, if not then nothing will show, this tag is intended for remove empty fields in user profile and comments
  2. [icq]xxx[/icq] is used for open and close tag if icq field {icq} was input, for example, in templates/Default/userinfo.tpl,

    Find:

    <li><span class="grey">ICQ:</span> <b>{icq}</b></li>
    

    Replace with:

    [icq]<li><span class="grey">ICQ:</span> <b>{icq}</b></li>[/icq]
    
    If the user input the information in icq filed then it will show, if not then nothing will show, this tag is intended for remove empty fields in user profile and comments
  3. [land]xxx[/land] is used for open and close tag if location field {land} was input, for example, in templates/Default/userinfo.tpl,

    Find:

    <li><span class="grey">Location:</span> {land}</li>
    

    Replace with:

    [land]<li><span class="grey">Location:</span> {land}</li>[/land]
    
    If the user input the information in location filed then it will show, if not then nothing will show, this tag is intended for remove empty fields in user profile and comments
  4. [info]xxx[/info] is used for open and close tag if short information field {info} was input, for example, in templates/Default/userinfo.tpl,

    Find:

    <li><span class="grey">Information:</span> {info}</li>
    

    Replace with:

    [info]<li><span class="grey">Information:</span> {info}</li>[/info]
    
    If the user input the information in short information filed then it will show, if not then nothing will show, this tag is intended for remove empty fields in user profile and comments
  5. [signature]xxx[/signature] is used for open and close tag if signature field {signature} was filled,

    For example:

    [signature]<hr /> <b>{signature}</b>[/signature]
    
    If the user filled the information in signature filed then it will show, if not then nothing will show, this tag is intended for remove empty fields in user profile and comments
  6. [news-num]xxx[/news-num] is used for open and close tag if the user have posted article in your website,

    For example:

    [news-num]<li style="margin-top:10px;">Posts: <b>{news-num}</b>  <span class="button">{news}</span> 
    [rss]<img alt="" src="{THEME}/images/ico/ico_rss.png" border="0" style="vertical-align:middle; margin-bottom: 3px;" title="Feed - Bookmark Posts" />[/rss]</li>[/news-num]
    
    If the user had posted at least 1 article in your website then it will show, if not then nothing will show, this tag is intended for remove empty fields in user profile and comments
  7. [comm-num]xxx[/comm-num] is used for open and close tag if the user have posted comment in your website,

    For example:

    [comm-num]<li style="margin-top:10px;">Comments: <b>{comm-num}</b> <span class="button">{comments}</span></li>[/comm-num]
    
    If the user had posted at least 1 comment in your website then it will show, if not then nothing will show, this tag is intended for remove empty fields in user profile and comments

Download File (Attached File)

Related Tutorials

Review/Leave Comment

comments powered by Disqus