digitalpoint |
06-03-2010 05:43 PM |
Quote:
Originally Posted by teenage.vn
(Post 2047492)
Firstly, I want to say that I'd appreciate for your quick support.
But ... I did the same thing in the post, means: change the exact words function play_pause() to the Code you gave in the post ... and I got the following warning when I tried to save the template:
Once again, sorry for bothering you and looking forward to hearing from you ...
------------------------------------------ Updated: ------------------------------------------
I also tried to Continue when facing the above error, and nothing changed ... still nothing to display ...
|
Any plans on upgrading to vBulletin 4.0.3? The problem itself is caused by vBulletin versions before 4.0.2 not able to parse templates properly.
If you have phpmyadmin, go into the templates table and search for the template record with the title of SPY. Edit that record (it should have a styleid of -1) and set the template field (NOT the template_un field) to this:
PHP Code:
$final_rendered = '' . vB_Template_Runtime::fetchStylevar("htmldoctype") . '
<html xmlns="http://www.w3.org/1999/xhtml" dir="' . vB_Template_Runtime::fetchStylevar("textdirection") . '" lang="' . vB_Template_Runtime::fetchStylevar("languagecode") . '">
<head>
' . $headinclude . '
<link rel="stylesheet" type="text/css" href="' . $vbcsspath . 'spy.css" />
<script type="text/javascript" src="' . vB_Template_Runtime::fetchStylevar("yuipath") . '/animation/animation-min.js?v=' . $vboptions['simpleversion'] . '"></script>
<script type="text/javascript">
var spymax = 25;
var play = 1;
var whats = new Array();
var titles = new Array();
var previews = new Array();
var whos = new Array();
var threadids = new Array();
var postids = new Array();
var userids = new Array();
var spyids = new Array();
var forumids = new Array();
var forumnames = new Array();
var highestid = 0;
var fadetime = .25;
var pushtime = 1500;
var fadetime_end = 1.5;
var pushtime_end = 4000
var initalfill_flag = 0;
function init() {
getXML();
}
function play_pause() {
var label = new Array(\'' . vB_Template_Runtime::parsePhrase("click_to_continue") . '\', \'' . vB_Template_Runtime::parsePhrase("click_to_pause") . '\');
play = Math.abs(1-play);
document.getElementById("play_pause").innerHTML = label[play];
}
function getXML() {
if (highestid > 0) {
var querystring = "do=xml&last=" + highestid;
} else {
var querystring = "do=xml";
}
if (document.getElementById("subscribed_flag").checked) {
querystring = querystring + "&subscribed=1";
}
querystring = querystring + \'&r=\' + Math.random();
YAHOO.util.Connect.asyncRequest("GET", "spy.php?" + SESSIONURL + "securitytoken=" + SECURITYTOKEN + "&" + querystring, {
success: processXML,
failure: vBulletin_AJAX_Error_Handler,
timeout: vB_Default_Timeout,
scope: this
});
}
function processXML (request) {
var events;
var event;
try {
events = request.responseXML.getElementsByTagName("events")[0];
event = events.getElementsByTagName("event");
}
catch (e) {
setTimeout("getXML()", 30000);
return;
}
for (i = 0; i < event.length; i++) {
try {
whats[i] = event[i].getElementsByTagName("what")[0].firstChild.nodeValue;
}
catch (e) {
whats[i] = "Who Knows";
}
try {
titles[i] = event[i].getElementsByTagName("title")[0].firstChild.nodeValue;
}
catch (e) {
titles[i] = "";
}
try {
previews[i] = event[i].getElementsByTagName("preview")[0].firstChild.nodeValue;
}
catch (e) {
previews[i] = "";
}
try {
whos[i] = event[i].getElementsByTagName("who")[0].firstChild.nodeValue;
}
catch (e) {
whos[i] = "Anonymous";
}
try {
threadids[i] = event[i].getElementsByTagName("threadid")[0].firstChild.nodeValue;
}
catch (e) {
threadids[i] = "";
}
try {
postids[i] = event[i].getElementsByTagName("postid")[0].firstChild.nodeValue;
}
catch (e) {
postids[i] = "";
}
try {
userids[i] = event[i].getElementsByTagName("userid")[0].firstChild.nodeValue;
}
catch (e) {
userids[i] = "";
}
try {
spyids[i] = event[i].getElementsByTagName("id")[0].firstChild.nodeValue;
}
catch (e) {
spyids[i] = 1;
}
try {
forumids[i] = event[i].getElementsByTagName("forumid")[0].firstChild.nodeValue;
}
catch (e) {
forumids[i] = 1;
}
try {
forumnames[i] = event[i].getElementsByTagName("forumname")[0].firstChild.nodeValue;
}
catch (e) {
forumnames[i] = 1;
}
}
push();
}
function push() {
if (play == 0) {
setTimeout("push()", 1000);
return;
}
var cell;
var cellnext;
var text;
var clip;
var who_clip = \'\';
var where = \'\';
var post_url;
var style = "";
var what = whats.pop();
var title = titles.pop();
var preview = previews.pop();
var who = whos.pop();
var threadid = threadids.pop();
var postid = postids.pop();
var userid = userids.pop();
var spyid = spyids.pop();
var forumid = forumids.pop();
var forumname = forumnames.pop();
highestid = Math.max(parseInt(spyid), highestid);
if (vB_PHP_Emulator.prototype.stripos(what, \'Thread\')) {
post_url = \'showthread.php?\' + SESSIONURL + \'t=\' + threadid;
} else {
post_url = \'showthread.php?\' + SESSIONURL + \'p=\' + postid + \'#post\' + postid ;
}
if (what == \'' . vB_Template_Runtime::parsePhrase("new_user") . '\') {
clip = \'<span style="font-weight:bold">' . vB_Template_Runtime::parsePhrase("new_user_registration") . '</span>\';
} else if(title.length == 0) { // Why??
clip = \'Unknown\';
} else {
clip = \'<a style="font-weight:bold" href="\' + post_url + \'">\' + title + \'</a>\';
}
if (preview.length > 0) clip = clip + \'<br /><div>\' + preview + \'</div>\';
if (userid.length > 0) {
who_clip = \'by <a href="member.php?\' + SESSIONURL + \'u=\' + userid + \'">\' + who + \'</a>\';
}
if (parseInt(forumname.length) > 0) {
if (who_clip.length > 0) where = \'<br />\';
where = where + \'<a style="font-weight:bold" href="forumdisplay.php?\' + SESSIONURL + \'f=\' + forumid + \'">\' + forumname + \'</a>\';
} else {
where = \'\';
}
text = \'<div class="what">\' + what + \'</div><div class="who">\' + who_clip + where + \'</div><div class="clip">\' + clip + "</div>";
document.getElementById("row1").style.opacity = 0;
for (i = (spymax - 1); i >= 1; i--) {
cell = document.getElementById("row" + i);
cellnext = document.getElementById("row" + (i + 1));
if (cell.innerHTML != "") {
cellnext.innerHTML = cell.innerHTML;
cellnext.style.display = \'\';
}
}
document.getElementById("row1").innerHTML = text;
FadeIn = new YAHOO.util.Anim("row1", {
opacity:{to: 1}
}, fadetime
);
FadeIn.animate();
if (whats.length > 0) {
setTimeout("push()", pushtime);
}
else {
fadetime = fadetime_end;
pushtime = pushtime_end;
setTimeout("getXML()", 5000);
}
}
</script>
<title>' . $vboptions['bbtitle'] . ' ' . vB_Template_Runtime::parsePhrase("spy") . '</title>
' . $headinclude_bottom . '
</head>
<body onload="init()">
' . $header . '
' . $navbar . '
<ul id="spy_options">
<li><label><input type="checkbox" id="subscribed_flag" value="1"> ' . vB_Template_Runtime::parsePhrase("include_subscribed") . '</label></li>
<li><a class="textcontrol" id="play_pause" href="spy.php" onclick="play_pause(); return false;">' . vB_Template_Runtime::parsePhrase("click_to_pause") . '</a></li>
</ul>
<div>
<span class="spyhead table">
<span class="what td">' . vB_Template_Runtime::parsePhrase("what") . '</span>
<span class="who td">' . vB_Template_Runtime::parsePhrase("who_where") . '</span>
<span class="clip td">' . vB_Template_Runtime::parsePhrase("thread_post") . '</span>
</span>
</div>
<ol id="spys">
<li class="spybit" id="row1"></li>
<li class="spybit" id="row2" style="display: none;"></li>
<li class="spybit" id="row3" style="display: none;"></li>
<li class="spybit" id="row4" style="display: none;"></li>
<li class="spybit" id="row5" style="display: none;"></li>
<li class="spybit" id="row6" style="display: none;"></li>
<li class="spybit" id="row7" style="display: none;"></li>
<li class="spybit" id="row8" style="display: none;"></li>
<li class="spybit" id="row9" style="display: none;"></li>
<li class="spybit" id="row10" style="display: none;"></li>
<li class="spybit" id="row11" style="display: none;"></li>
<li class="spybit" id="row12" style="display: none;"></li>
<li class="spybit" id="row13" style="display: none;"></li>
<li class="spybit" id="row14" style="display: none;"></li>
<li class="spybit" id="row15" style="display: none;"></li>
<li class="spybit" id="row16" style="display: none;"></li>
<li class="spybit" id="row17" style="display: none;"></li>
<li class="spybit" id="row18" style="display: none;"></li>
<li class="spybit" id="row19" style="display: none;"></li>
<li class="spybit" id="row20" style="display: none;"></li>
<li class="spybit" id="row21" style="display: none; opacity:.85"></li>
<li class="spybit" id="row22" style="display: none; opacity:.65"></li>
<li class="spybit" id="row23" style="display: none; opacity:.45"></li>
<li class="spybit" id="row24" style="display: none; opacity:.25"></li>
<li class="spybit" id="row25" style="display: none; opacity:.05"></li>
</ol>
<br clear="both" />
' . $footer . '
</body>
</html> ';
That is the parsed template from a version of vBulletin that can parse templates properly. Ultimately the best thing to do would be to upgrade to a version of vBulletin that can parse templates correctly, but if that's not an option manually parsing it like shown above should work.
|