wordpress plugin

Discussion in 'PHP' started by asgsoft, Mar 26, 2012.

  1. #1
    Hey guys,

    I am a little stuck and need some help.

    So I've made a basic wordpress plugin which creates a short tag "[review id=1]"

    This short tag would then query a mysql database and display the info for the review with $id 1 which works fine.

    The problem is, part of the review calls on another plugin, http://wordpress.org/extend/plugins/mombly-review-rating/ to display the rating as in stars by displaying "[Rating:4/5]"

    However, rather than displaying the picture, "[Rating:4/5]" is written down whereas normally I'd get 4 stars.

    Is there anyway I can fix that?

    Cheers
     
    asgsoft, Mar 26, 2012 IP
  2. cinigallery

    cinigallery Greenhorn

    Messages:
    63
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    16
    #2
    Iam using WP-PostRatings plugin and it is working fine for me.try your self
     
    cinigallery, Mar 26, 2012 IP
  3. Gantro

    Gantro Member

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    i'm also use WP-PostRatings very convenient
     
    Gantro, Mar 26, 2012 IP
  4. asgsoft

    asgsoft Well-Known Member

    Messages:
    1,737
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    160
    #4
    has anyone here read my problem? I have the spammy replies.
     
    asgsoft, Mar 26, 2012 IP
  5. Grit.

    Grit. Well-Known Member

    Messages:
    1,424
    Likes Received:
    22
    Best Answers:
    1
    Trophy Points:
    110
    #5
    Have you checked the priority of your plugin? it sounds to me like the second plugin is running before you have added your rating. Go into your plugin, and make it run before the second plugin, or adjust the other plugin (that isn't yours), to run after your plugin has inserted the shortcode
     
    Grit., Mar 26, 2012 IP
  6. asgsoft

    asgsoft Well-Known Member

    Messages:
    1,737
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    160
    #6
    How do I change priorities?

    It seems to load my plugin before the rating one and also the built in theme functions. Is there a way to make my plugin be the last to load?

    edit:

    come to think of it, I'd want mine to be the last one so that all the other plugins and template functions would've had a chance to load.
     
    Last edited: Mar 26, 2012
    asgsoft, Mar 26, 2012 IP
  7. Grit.

    Grit. Well-Known Member

    Messages:
    1,424
    Likes Received:
    22
    Best Answers:
    1
    Trophy Points:
    110
    #7
    But you said that the rating system was via a plugin. Just make that run later.

    Exerpt from the API:

     
    Grit., Mar 26, 2012 IP
  8. asgsoft

    asgsoft Well-Known Member

    Messages:
    1,737
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    160
    #8
    When I add:

    to the bottom of the plugin, it gets rid of the value of $id

    The reason I mentioned template too is because certain template widgets are malfunctioning in the presence of this plugin/shortcode
     
    asgsoft, Mar 26, 2012 IP
  9. Grit.

    Grit. Well-Known Member

    Messages:
    1,424
    Likes Received:
    22
    Best Answers:
    1
    Trophy Points:
    110
    #9
    So is it the rating image plugin that's causing the malfunctions?
    Plus, using 0 makes it the top priority.

    So if you want your plugin to run first and insert your on the fly code, make your plugin 0, or a number lower than the rating image one
     
    Grit., Mar 26, 2012 IP
  10. asgsoft

    asgsoft Well-Known Member

    Messages:
    1,737
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    160
    #10
    The addition of:

    regardless of the priority number causes the $id to stop working :S

    edit:

    would you mind if I sent you the code to have a look at?
     
    asgsoft, Mar 26, 2012 IP
  11. Grit.

    Grit. Well-Known Member

    Messages:
    1,424
    Likes Received:
    22
    Best Answers:
    1
    Trophy Points:
    110
    #11
    have you tried altering the priority numbers on both the plugins? And sure, go for it. Has the review rating plugin ever worked on your site?
     
    Grit., Mar 26, 2012 IP
  12. asgsoft

    asgsoft Well-Known Member

    Messages:
    1,737
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    160
    #12
    I've tried altering both priorities with no luck.

    the review plugin works great on the site at the moment.

    Here is the current working version of it: http://pastebin.com/qiUy6hj2
     
    Last edited: Mar 26, 2012
    asgsoft, Mar 26, 2012 IP