vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Javascript confirmation box (https://vborg.vbsupport.ru/showthread.php?t=246826)

Falcon Capt 07-19-2010 08:55 PM

Quote:

Originally Posted by Boofo (Post 2071741)
Where did you end up putting the js code?

At the very top of the navbar template.

Guest190829 07-19-2010 08:59 PM

No problem. :)

And Boofo is right, javascript should go in the headinclude template.

Falcon Capt 07-19-2010 09:08 PM

Quote:

Originally Posted by Danny.VBT (Post 2071745)
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?

Guest190829 07-19-2010 09:16 PM

This occurred with the new version? Or has been happening?

Falcon Capt 07-20-2010 06:33 PM

Quote:

Originally Posted by Danny.VBT (Post 2071750)
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).

Boofo 07-20-2010 06:43 PM

Is there anyway to check if the browser handles js and use the regular link for those occasions that it doesn't?

Falcon Capt 07-20-2010 06:55 PM

Quote:

Originally Posted by Boofo (Post 2072147)
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.)

Guest190829 07-20-2010 07:06 PM

Can you check the URL upon redirect? Is there a hash in the query string?

Falcon Capt 07-20-2010 07:43 PM

Quote:

Originally Posted by Danny.VBT (Post 2072156)
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.

omerfarukak 08-28-2011 07:33 AM

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?


All times are GMT. The time now is 08:26 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.01830 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete