The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Plugin Help - str_replace ?
I'm still a novice, that's why I'm asking here!
I'd like to create a plugin that will do a simple string replace on the "<HTML>" tag on ALL pages. I want to replace <html ......> with <html id=blah ......> I have previously done a search and replace on all templates, but thought a plugin would be nicer - I try not to manually edit any templates. Any help appreciated - thanks |
#2
|
||||
|
||||
Templates are called with the fetch_template function, have a look in that. It probably lives in functions.php or bigthree, I don't have vb handy to check.
|
#3
|
||||
|
||||
Wouldn't that already be parsed at that point?
|
#4
|
||||
|
||||
It'd might easier to do this with a little bit of javascript in the headinclude template (or add it to $headinclude in a plugin like global_start).
Something like this might do it ... HTML Code:
<script type="text/javascript"> <!-- window.addEvent('domready', function () { document.getElementsByTagName('html')[0].setAttribute('id','blah'); }); --> </script> |
#5
|
|||
|
|||
No joy with this - i'm thinking old fashioned search and replace may be easiest...
Thanks for the suggestions! |
#6
|
||||
|
||||
Ooops, my apologies, I've been coding with Mootools for too long, keep forgetting vB doesn't use it! So window.addEvent() doesn't exist.
Don't really need it tho. Just do this somewhere in headinclude: HTML Code:
<script type="text/javascript"> <!-- document.getElementsByTagName('html')[0].setAttribute('id','blah'); --> </script> HTML Code:
<html id="blah" lang="en" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
(DOM is the Document Object Model, the actual structure of your page within the browser) -- hugh |
#7
|
|||
|
|||
Will test this out later - thanks. Wonder how Google and the link will see it? I'm testing a theory that google uses ID tags when ranking keywords and thinking this may be yet another SEO helper ...
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|