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 04-17-2008, 11:47 AM
ishare ishare is offline
 
Join Date: Jun 2006
Location: Stockholm
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Javascript problem

Hi,
I need help with javascript. And its really quite important for me to solve this problem.
I would like to use a tab panel in my current showthread.php
I did add the .css styles and also the javascript (.js) code to the root directory. Everything is fine.
But due to a reason i do not know, vbulletin convert the links.

The tab example :
http://www.divx-world.com/tab.html

So the link of tab1 and others should be like "javascript:;" but vbulletin convert this link to "javascript%3Cb%3E%3C/b%3E:;"

Please help me about this problem so i can solve it.

Thanks in advance...
Reply With Quote
  #2  
Old 04-17-2008, 02:43 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried turning off your modifications and seeing if the issue is fixed? I have never heard of vbulletin doing that to links.
Reply With Quote
  #3  
Old 04-17-2008, 02:44 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems to work fine for me in firefox.
Reply With Quote
  #4  
Old 04-17-2008, 03:00 PM
ishare ishare is offline
 
Join Date: Jun 2006
Location: Stockholm
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your answers and helps, but :

Lynne : I try to use this java script tab panel on a clean vbulletin. So there is no any modification.

Opserty : The link i gave above is an example of what i want to do on my vbulletin. Thats working fine. But when i use same thing inside vbulletin, it changes the links to as mentioned above.
Reply With Quote
  #5  
Old 04-17-2008, 03:27 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh ok, well thats fairly useless

It would be helpful to see an example in vBulletin that has the issue.
Reply With Quote
  #6  
Old 04-17-2008, 03:37 PM
ishare ishare is offline
 
Join Date: Jun 2006
Location: Stockholm
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am really sorry that i did not give that address much more before.

Here is an example in vBulletin :
http://www.divx-world.com/showthread.php?p=42114

It may seems that its working. Luckly its working in this thread. But actually when i add some other info into tab panel content, tabs doesnt work.

And as you can see, when you come on a tab, the link appear as : http://www.domain-name.com/javascript%3Cb%3E%3C/b%3E:;

But originally it should be as "javascript:;"
Reply With Quote
  #7  
Old 04-17-2008, 03:48 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looking at the source code for your tabs on that page, I see this:

<a class="down" href="javascript<b></b>:;">Film Bilgileri</a>

What does it say in your template because you shouldn't have that html in there (although the tabs work for me, as you noted).
Reply With Quote
  #8  
Old 04-17-2008, 04:20 PM
ishare ishare is offline
 
Join Date: Jun 2006
Location: Stockholm
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Below, is the code of this tab panel i used in showthread template. Ofcourse the codes after the body tag. So as you can see through the original code on showthread.php template, the links should be as "javascript:;"

As you also mentioned, its working at first post. But when i add some info to the panel content (example given below) the tabs doesnt work anymore.

Example of the modified content :
http://www.divx-world.com/showthread.php?p=42238

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css" media="screen">
<!--
@import url("p7tp/p7tp_01.css");
-->
</style>
<script type="text/javascript" src="p7tp/p7tpscripts.js"></script>
</head>

<body onload="P7_initTP(1,0)">
<div id="p7TP1" class="p7TPpanel">
  <div class="p7TPheader">
    <h3><strong>Filmin Adı Buraya Yazılacak!</strong></h3>
  </div>
  <div class="p7TPwrapper">
    <div class="p7TP_tabs">
      <div id="p7tpb1_1" class="down"><a class="down" href="javascript:;">Film Bilgileri</a></div>
      <div id="p7tpb1_2"><a href="javascript:;">Dublaj Bilgileri</a></div>
      <div id="p7tpb1_3"><a href="javascript:;">Altyazı Bilgileri</a></div>
      <div id="p7tpb1_4"><a href="javascript:;">Kodek Bilgileri</a></div>
      <div id="p7tpb1_5"><a href="javascript:;">Ek Bilgiler</a></div>
      <br class="p7TPclear" />
    </div>
    <div class="p7TPcontent">
      <div id="p7tpc1_1">
        <h4>Panel Content...</h4>
        <p>Bu b?l?m i?erisinde filmin dvd kapağı veya afişi ile birlikte, ekran g?r?nt?leri yer alabilir.</p>
      </div>
      <div id="p7tpc1_2">
        <h4>Panel Content...</h4>
        <p>Bu b?l?mde ise paylaşılan filmdeki dublaj se?enekleri g?rsel a?ıdan  daha g?zel olacak (?lke bayrakları ile birlikte) şekilde detaylı olarak  sunulabilir.</p>
      </div>
      <div id="p7tpc1_3">
        <h4>Panel Content...</h4>
        <p>Bu b?l?mde ise, dublaj se?eneklerinde olduğu gibi yine g?rsel ve  anlaşılabilirlilik a?ısından daha g?zel olacak bir i?erikle sunulabilir.</p>
      </div>
      <div id="p7tpc1_4">
        <h4>Panel Content...</h4>
        <p>?zellikle DVDRip veya HDRip paylaşımlarda ?ok ?nemli olduğundan dolayı,  bu b?l?mde paylaşılan filme ait ?eşitli kodek bilgileri sunulabilir.</p>
      </div>
      <div id="p7tpc1_5">
        <h4>Panel Content...</h4>
        <p>Son olarak bu b?l?mde ise, eğer gerekli ise ek a?ıklamalarda  bulunulabilir. Filmde yaşanan herhangi bir sorun veya d?zeltme ile  ilgili olarak ?nceden bilgi vermek adına bu b?l?m faydalı olacaktır</p>
      </div>
    </div>
  </div>
  <!--[if lte IE 6]>
<style type="text/css">.p7TPpanel div,.p7TPpanel a{height:1%;}.p7TP_tabs a{white-space:nowrap;}</style>
<![endif]-->
</div>
</body>
</html>
Reply With Quote
  #9  
Old 04-17-2008, 05:28 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A couple of things... I'm not javascript expert, but those links just don't seem right. Usually I see a call as
Code:
<a href="javascript:function()">blahblah</a>
The second thing I notice is that you are using an id in your div tags <div id="p7tpb1_1" class="down"> that is not unique. You should be grabbing the postid and using that in the id to create a unique id - <div id="p7tpb1_$postid_1" class="down">. You cannot have two things with the same id or it doesn't work (as you can see in your second post).
Reply With Quote
  #10  
Old 04-17-2008, 05:57 PM
ishare ishare is offline
 
Join Date: Jun 2006
Location: Stockholm
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The line which calls the javascript (located in showthread.php) :
<script type="text/javascript" src="p7tp/p7tpscripts.js"></script>

The line which calls the .css file (located in showthread between <head> tags :
<!--
@import url("p7tp/p7tp_01.css");
-->
</style>

So i beleive there is nothing wrong with those id's.

But please let me say it again that, i do appreciate a lot all your kind responses Lynne. Thank you very much. I hope some other friends will also help or advise me about how to solve this problem.

Due my website is movie review site, each thread has very long and different comments. So with this tab panel, i would like to have cleaner and better looking forum.
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 04:31 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.04295 seconds
  • Memory Usage 2,255KB
  • Queries Executed 13 (?)
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_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete