vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Can Javascript be run from the plugin system? (https://vborg.vbsupport.ru/showthread.php?t=133371)

RedTyger 11-29-2007 12:36 PM

You'll probably want to change the title to something other than vB Ad Management as well, I forgot. :)

ragtek 11-29-2007 12:38 PM

instead of body onload => use
Code:

window.onload=.....
so you have not to edit the body tag ;)

RedTyger 11-29-2007 12:42 PM

Also good. Come to that, showthread's onload javascript is a variable so you could probably tack additional onload stuff onto the end as well. Instead of a str_replace.

Choices choices. :)

JPnyc 11-29-2007 12:43 PM

THANK YOU!!!! Actually, ad management is precisely what I'm trying to do. I want to enable the forums Ajax features, however we make our living off ad revenue, and as you know, Ajax doesn't reload the page, so we lose significantly on ad delivery. What I'm trying to do is reload the ad positions along with the edit and quick reply Ajax events.

RedTyger 11-29-2007 12:48 PM

Something like the option to refresh adverts every X seconds, does that sound worth doing? It's not what you're trying to achieve, but generally speaking...?

JPnyc 11-29-2007 01:01 PM

I'm not sure we can actually do that, but I'll check. The problem is we are serving our ads via PHP, meaning PHP is writing the JavaScript setup code to the page. I haven't been able to figure out away to refresh the variable call by hooking it on the Ajax start and Ajax complete hooks. That would be ideal, if I could do that way.

So what I've been trying to do, in lieu of that, is dynamically write the JavaScript function that calls the ad, by using JavaScript onclick of the edit and quick reply submit buttons. So I'm writing one JavaScript function to the page with another, using innerHTML, because it's easier than using the DOM methods in this instance.

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

RedTyger, I looked over that plugin you graciously attached. Am I correct that it adds a link to a remote JavaScript located in the client script directory, and calls it on page load?

JPnyc 12-07-2007 11:49 AM

FYI, this issue is resolved. I ended up writing my own AJAX script to refresh our ad positions, and calling it onclick of the quick edit and quick reply buttons. Unfortunatly, the quick edit SAVE button is dynamically written and I can't get at it to add the onclick event. But 2 out of 3 ain't bad...

RedTyger 12-08-2007 09:13 AM

Oh, good job. I ended up adding a timed AJAX advertisement refresh to my ad manager off the back of this, though its not really related. Seems to be appreciated. :)


All times are GMT. The time now is 02:00 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.01683 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)bbcode_code_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
  • (8)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