Smileys "403 Forbidden" on Any page but Category Overview Page

woftwoft
edited May 2014 in Vanilla 2.0 - 2.8

Ok so I have a problem,

when viewing the shoutbox with smileys (The version on GitHub) it works perfectly on the Main Category Page i.e. the first page i load on the forums. however, when the shoutbox is loaded on a sub-category or discussion page the shoutbox loads fine but the emoji smileys get a
"NetworkError: 404 Not Found - http://mysite.co.uk/vanilla/categories/plugins/Van2Shout/img/emoji/smiley.png"
The reason this error is appearing is obviously because vanilla adds the "/categories/" as soon as it goes past the main page and into a category section.
normally the plugin looks for the images in
"http://mysite.co.uk/vanilla/plugins/Van2Shout/img/emoji/smiley.png" but when the categories part is added to the URL it obviously breaks the link.

How do I go about either, telling van2shout to always look in the same place, or stop vanilla posting the "categories" into the Van2Shout module URL.

Using Vanila v2.1

Woft

Comments

  • peregrineperegrine MVP
    edited May 2014

    403 forbidden. you should change your permissions. and change this line

    in class.van2shout.plugin.php
    
    from:
    
        public function SettingsController_Van2Shout_Create($Sender) {
                $Sender->Permission('Garden.Plugins.Manage');
    
    to:
    
        public function SettingsController_Van2Shout_Create($Sender) {
                $Sender->Permission('Garden.Settings.Manage');
    

    for the js

    there is probably a more dynamic way to do this. - but to fix for your site

    add in the http://yourhost.com/yourforum or your forum in this place.

    plugins/Van2Shout/js/emojify.min.js

         */!function(a){var b=function(){function b(a){return" "===a||" "===a||"\r"===a||"\n"===a||""===a}function c(a,b,c){var d=i.createElement("img");d.setAttribute("title",":"+c+":"),d.setAttribute("class","emoji"),d.setAttribute("src",q.img_dir+"/"+
    
        see how I added "http://localhost/vanilla/" +    into the js script.
    
         */!function(a){var b=function(){function b(a){return" "===a||" "===a||"\r"===a||"\n"===a||""===a}function c(a,b,c){var d=i.createElement("img");d.setAttribute("title",":"+c+":"),d.setAttribute("class","emoji"),d.setAttribute("src","http://localhost/vanilla/" + q.img_dir+"/"+
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • woftwoft
    edited May 2014

    Worked perfectly! As always peregrine, I bow down to your awesome and insightful knowledge!

  • peregrineperegrine MVP
    edited May 2014

    this is better.

    I added the gdn.definition('WebRoot')+ "/" +

    @caerostris @‌woft more dynamic...

    change...

    */!function(a){var b=function(){function b(a){return" "===a||" "===a||"\r"===a||"\n"===a||""===a}function c(a,b,c){var d=i.createElement("img");d.setAttribute("title",":"+c+":"),d.setAttribute("class","emoji"),d.setAttribute("src",q.img_dir
    
    
    to
    
     */!function(a){var b=function(){function b(a){return" "===a||" "===a||"\r"===a||"\n"===a||""===a}function c(a,b,c){var d=i.createElement("img");d.setAttribute("title",":"+c+":"),d.setAttribute("class","emoji"),d.setAttribute("src",gdn.definition('WebRoot')+ "/" + q.img_dir
    

    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 just pushed your updates @‌peregrine
    Thanks a lot!

  • @woft said:
    Worked perfectly! As always peregrine, I bow down to your awesome and insightful knowledge!

    I am permanently bowed down for the same reason :D

Sign In or Register to comment.