TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,250
  • Total Topics: 21,354
  • Online today: 626
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

[?]Slide Left Bar!

Started by G60, March 14, 2007, 07:57:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

G60

Hello.

I installed tp and musiconica theme on SMF. TP is a great modification.
My question:
I want the slide lef bar. For example my phpbb forum.
http://www.caraudioturkey.com/forum/
I can do this on phpbb. But it doesn't work on smf.
How can I do it?

I try this index.template.php code.
http://www.pgtasarim.com/tema/crip.txt

Zetan

I must admit... that is really annoying.. cool, but annoying.

ZTN

G60

But my advertisment agree is sliding ads. If do this, i convert phpbb to smf.
I must do this. :)

Zetan

I have seen it before on other sites, never seen it on a TP/SMF site.
There is a mod here that allows members to move blocks wherever they want.
Floating Blocks or something.

That might be adaptable, look in the block code snippits here. It won't do what you need out of the box, but somebody might be able to help.


What is the script on the current site that enables that?
That would be a good place to start.


ZTN


IchBin

I am sure this will have to be done by hard coding it into the template. If you'd like can you post the code and stuff that this script requires and I'll see what I can do?

G60

#5
The javascript code:
The code fonction, find <div id="sponsoraddiv">   div, and slide this....
<script language="JavaScript" type="text/javascript">
var persistclose=0
var startX = 13
var startY = 0
var verticalpos="frombottom"

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function closebar(){
if (persistclose)
document.cookie="remainclosed=1"
document.getElementById("sponsorAdDiv").style.visibility="hidden"
}

function staticbar(){
barheight=document.getElementById("sponsorAdDiv").offsetHeight
var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
var d = document;
function ml(id){
var el=d.getElementById(id);
if (!persistclose || persistclose && get_cookie("remainclosed")=="")
el.style.visibility="visible"
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function(){
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : iecompattest().scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("sponsorAdDiv");
stayTopLeft();
}

if (window.addEventListener)
window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
window.attachEvent("onload", staticbar)
else if (document.getElementById)
window.onload=staticbar
</script>






I try left bar codes into div, but i did'nt see any changes. Sorry for my English. :(


// TinyPortal integrated bars


echo '
<div id="sponsorAdDiv">';
if($context['TPortal']['leftbar'])
{
  echo '<td width="' ,$context['TPortal']['leftbar_width'], '" style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' , 'px; background-color: transparent; padding-top: 4px;" valign="top">
  <div id="leftbarHeader"', empty($options['collapse_leftbar']) ? '' : ' style="display: none;"', ' style="padding-top: 5px; width: ' ,$context['TPortal']['leftbar_width'], 'px;">';
  TPortal_sidebar('left');
  echo '</div></td>';
  }
echo ' </div>';
 
 
  echo '<td width="100%" align="left" valign="top" style="padding-top: 10px; padding-bottom: 10px;">';
  if($context['TPortal']['centerbar'])
echo '<div>' , TPortal_sidebar('center') , '</div></div>';
}

Zetan

could you wrap "code" tags around the script?
It's hard to read, and it wont work properly in a post as it is.


IchBin

Where does it have the javascript code in your other site? In the <head> tags? Or anywhere in the page?

Crip

G60 ask me, I had no idea how..never saw a TP site do the slide
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



Crip

I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



This website is proudly hosted on Crocweb Cloud Website Hosting.