Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to add a javascript inside a post or thread
aery
✭✭✭
I would like to add adsense javascript or say any other javascript inside the content area.
Pockets addon wont do that. Any other solution?
There was an error rendering this rich post.
0
Best Answers
-
peregrine MVP
if it was comment id 182 ... $Object = ($Sender->EventArguments['Comment']); if(($Object->CommentIDName) == "182") {
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
1 -
UnderDog MVP
Update GDN_Discussion SET Format='Raw' Where DiscussionID = 46
There was an error rendering this rich post.
0
Answers
http://vanillawiki.homebrewforums.net/index.php/Adding_Some_JQuery_to_a_Plugin
I could probably give you a hand (if no one else chimes in) if you want to tell me what and where you want to go.
maybe an image pointing to where you want it or your site.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
just add $Sender->AddJsFile('plugins/Pockets/mynew.js');
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I reread your title questions maybe something like this - no real need for jquery if you just want to reformat things on the fly. if the above doesn't work.
}
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
If you are just trying to shove a bit of code between posts pockets will do the trick. If you need to actually perform includes i have a very much "not for distribution" plugin i cal jsInserter. I could send it to you, but you have to modify the plugin to add your code to insert. It would take me a day or two to comment it up so you could use it. PM me if its something you want.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
@peregrine and @hbf thanks for answers.
However I want some script inside the post
like
<script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
Or Adsense code inside only a specific thread, not on all the pages.
There was an error rendering this rich post.
@peregrine and @hbf thanks for answers.
However I want some script inside the post
like
<script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
Or Adsense code inside only a specific thread, not on all the pages.
There was an error rendering this rich post.
why in the post. You could create a special post, but why not do it dynamically?
you could do similar to this but for discussions:
http://vanillaforums.org/addon/adsensebetweenthreads-plugin
grep is your friend.
Dont insert that in a post.
There was an error rendering this rich post.
Not saying its a good idea or bad but ..
I'm totally confused what exactly you want. But couldn't you do something like this. In this example it add the script to messages authored by mary.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@x00 @422 I need to to this because there is a specific post that gets tons of traffic from search engine however community members are not interested in that old post. So, I thought why not monetize that page but putting some adsense units at top and bottom of writeup.
@peregrine - Thanks for that code. Its looks that this will work for me. Can I replace "Author" in EventArguments['Author'] with post id?
There was an error rendering this rich post.
I think adding this
$DiscussionID = $Sender->EventArguments['Discussion']->DiscussionID;
should do the trick. I will try this in the weekend. Please remind me if I forget.
There was an error rendering this rich post.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
You only want it on one post? Set the Format to Raw in the database, then enter whatever code.
Lock the discussion.
grep is your friend.
Certainly would save the extra conditional done on all comments wouldn't it.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Thats great. But the proble is, How and where do I set the format to raw?
There was an error rendering this rich post.
Unfortunately, editing body field after running
SELECT* FROM GDN_Discussion WHERE DiscussionID =46 LIMIT 0 , 30
didn not work.
I couldnt find raw option.
There was an error rendering this rich post.
Update GDN_Discussion SET Format='Raw' Where DiscussionID = 46
There was an error rendering this rich post.
.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Worked like a charm. Thanks @Underdog.
There was an error rendering this rich post.