Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 07-19-2010, 09:55 PM
Falcon Capt Falcon Capt is offline
 
Join Date: May 2006
Location: U.S.
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo View Post
Where did you end up putting the js code?
At the very top of the navbar template.
Reply With Quote
  #12  
Old 07-19-2010, 09:59 PM
Guest190829
Guest
 
Posts: n/a
Default

No problem.

And Boofo is right, javascript should go in the headinclude template.
Reply With Quote
  #13  
Old 07-19-2010, 10:08 PM
Falcon Capt Falcon Capt is offline
 
Join Date: May 2006
Location: U.S.
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Danny.VBT View Post
No problem.

And Boofo is right, javascript should go in the headinclude template.
Ok, moved it to the header_includes template.

One other problem I am having with this script. Occasionally in certain browsers, I get a "Your Submission could not be processed due to an invalid security token" error when trying to Mark All Read. Doesn't happen in IE8, but happens on the browser on my Droid (Safari derivative I believe).

Any thoughts?
Reply With Quote
  #14  
Old 07-19-2010, 10:16 PM
Guest190829
Guest
 
Posts: n/a
Default

This occurred with the new version? Or has been happening?
Reply With Quote
  #15  
Old 07-20-2010, 07:33 PM
Falcon Capt Falcon Capt is offline
 
Join Date: May 2006
Location: U.S.
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Danny.VBT View Post
This occurred with the new version? Or has been happening?
Actually happened in 3.8.5 as well. Only seems to be certain browsers (mostly mobile browsers). Almost appears as though the browser isn't passing the security hash through the script (it is a java enabled browser).
Reply With Quote
  #16  
Old 07-20-2010, 07:43 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there anyway to check if the browser handles js and use the regular link for those occasions that it doesn't?
Reply With Quote
  #17  
Old 07-20-2010, 07:55 PM
Falcon Capt Falcon Capt is offline
 
Join Date: May 2006
Location: U.S.
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo View Post
Is there anyway to check if the browser handles js and use the regular link for those occasions that it doesn't?
The browser does handle js. If I remove the following code from FORUMDISPLAY.PHP it works properly:

Code:
// Prevent CSRF. See #32785
$vbulletin->input->clean_array_gpc('r', array(
'markreadhash' => TYPE_STR,
));
if (!verify_security_token($vbulletin->GPC['markreadhash'], $vbulletin->userinfo['securitytoken_raw']))
{
eval(standard_error(fetch_error('security_token_invalid', $vbulletin->options['contactuslink'])));
}
So it is something with the CSRF protection (this issues started with vB 3.8.5 when they put CSFR protection on the Mark All Read function.)
Reply With Quote
  #18  
Old 07-20-2010, 08:06 PM
Guest190829
Guest
 
Posts: n/a
Default

Can you check the URL upon redirect? Is there a hash in the query string?
Reply With Quote
  #19  
Old 07-20-2010, 08:43 PM
Falcon Capt Falcon Capt is offline
 
Join Date: May 2006
Location: U.S.
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Danny.VBT View Post
Can you check the URL upon redirect? Is there a hash in the query string?
I really can't tell as there is no way to see the full link during the redirect on the mobile browser.
Reply With Quote
  #20  
Old 08-28-2011, 08:33 AM
omerfarukak omerfarukak is offline
 
Join Date: Jan 2011
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm trying to use this method but when i add this function and hit the save button, it says

Fatal error: Maximum function nesting level of '100' reached, aborting! in /var/www/includes/vb_template.php on line 51

how can i resolve this problem?

--------------- Added [DATE]1314536746[/DATE] at [TIME]1314536746[/TIME] ---------------

Finally, i can include this function from external file...

But now it's not working with vb4.1.5

I've add
Code:
<script type="text/javascript" src="markread.js"></script>
this to headerinclude and it's contains
Code:
function markAsRead(session, markreadhash)
{
 var markRead = confirm("Butun mesajlar okundu kabul edilecek. Emin misiniz?");
 if (markRead == true)
 { window.location="forumdisplay.php?" + session + "do=markread&amp;markreadhash=" + markreadhash;
 }
 else
 {    
  }
}
then i'have change mark as read link with this
Code:
<a href="javascript:markAsRead({vb:raw session.sessionurl},{vb:raw bbuserinfo.securitytoken});">{vb:rawphrase mark_forums_read}</a>
This doesn't work... What can we do?
Reply With Quote
Reply

Thread Tools
Display Modes

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:56 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.04762 seconds
  • Memory Usage 2,251KB
  • 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
  • (4)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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
  • (7)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_postinfo_query
  • fetch_postinfo
  • 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