Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-03-2003, 12:53 AM
ixian's Avatar
ixian ixian is offline
 
Join Date: Oct 2001
Location: Denver, CO
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Rollovers in Postbit

What's the magic trick to get rollovers to work in the Postbit? Such as for the icons for profile, reply, quote, etc etc.

I have js rollovers working just fine in my vb header. However, when I try the exact same code even, in postbit (such as modifying postbit_profile and adding the rollover code to the link) it does not work.

I've double-checked the images - there are there in the right paths. And I don't get any javascript errors on the page - just no rollovers either. I have the js code in my vb header but I am wondering, do I need to insert it somewhere else for rollover images to work in the postbit?

Anyone with any examples? I'd really appreciate it!

Thanks,

Ixian
Reply With Quote
  #2  
Old 03-03-2003, 02:54 AM
Tony G's Avatar
Tony G Tony G is offline
 
Join Date: Nov 2001
Location: Melbourne, Australia
Posts: 8,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What code are you using? So I can check it over for you.
Reply With Quote
  #3  
Old 03-03-2003, 03:16 AM
Chris Gwynne's Avatar
Chris Gwynne Chris Gwynne is offline
 
Join Date: Jan 2003
Posts: 316
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Everything should work if you have the code in the header, make sure there is actual images to rollover like quoteroll.gif or something like that. But, like Tony said, show us the code..
Reply With Quote
  #4  
Old 03-03-2003, 03:26 AM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Acully it would be better to stick it under the $header call in the showthread template so it isent loaded on all pages.
Reply With Quote
  #5  
Old 03-03-2003, 04:39 AM
Chris Gwynne's Avatar
Chris Gwynne Chris Gwynne is offline
 
Join Date: Jan 2003
Posts: 316
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Anime-loo
Acully it would be better to stick it under the $header call in the showthread template so it isent loaded on all pages.
Although if you have a separate .js file, it won't really matter, will load quicker too
Reply With Quote
  #6  
Old 03-03-2003, 03:28 PM
ixian's Avatar
ixian ixian is offline
 
Join Date: Oct 2001
Location: Denver, CO
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Huh. I would sworn I selected email notification for this thread, but I didn't get any.

Anyway, the code looks something like this:

In the head insert template:

PHP Code:
<script language="JavaScript">
<!--

function 
MM_preloadImages() { //v3.0
  
var d=document; if(d.images){ if(!d.MM_pd.MM_p=new Array();
    var 
i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0i<a.lengthi++)
    if (
a[i].indexOf("#")!=0){ d.MM_p[j]=new Imaged.MM_p[j++].src=a[i];}}
}

function 
MM_findObj(nd) { //v4.01
  
var p,i,x;  if(!dd=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    
d=parent.frames[n.substring(p+1)].documentn=n.substring(0,p);}
  if(!(
x=d[n])&&d.allx=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(
i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!
&& d.getElementByIdx=d.getElementById(n); return x;
}

function 
MM_showHideLayers() { //v6.0
  
var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (
i=0i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (
obj.style) { obj=obj.stylev=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    
obj.visibility=v; }
}

function 
MM_swapImgRestore() { //v3.0
  
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function 
MM_swapImage() { //v3.0
  
var i,j=0,x,a=MM_swapImage.argumentsdocument.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((
x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrcx.oSrc=x.srcx.src=a[i+2];}
}
//-->
</script
And then, for example, in Postbit_profile (for the profile button in Postbit):

PHP Code:
<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$post[userid]onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image110','','/assets/images/profile_01-over.gif',1)"><img src="/assets/images/profile_01.gif" alt="Profile" name="Image110" width="72" height="22" border="0"></a
Now, as I mentioned, if I put the link above in the header template, it works fine. So, the code is working, and the images are there.

It just doesn't work if placed in, for example, postbit_profile, and I don't know why.

Could be I horked something up since I use that code for rollovers in my header already anyway. Any ideas???

Thanks!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:07 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.12295 seconds
  • Memory Usage 2,246KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete