• Hello everyone,
    I have developed an netflix plugin for wordpress. https://www.jimmyoliver.net
    I have a question about the best way to output the data for use by the masses. Right now, when mynetflix() function is called, I output the information directly wrapped in wptexturize. So in my index.php all i have to do is add a
    <?PHP mynetflix(); ?>

    and I get output like this

    <li><H2>MyNetflix Movies</H2>
    <ul>
    <li>movie</li>
    <li>movie</li>
    <li>movie</li>
    </ul>
    </li>

    This works well since this it the structure for the kubrick theme sidebar. But if another theme is used, it will probably look strange since the first <li> is nested inside a previousley declared <ul>. So what I have been thinking is this. Either I output an assoc array. This will make formatting subject to whatever the theme is. This is more complicated since I till require more complex code in index.php.
    Or I could offer 2 functions, 1 with formatted output, and 1 that returns an assoc array. Any thoughs on this? You can see an example of the plugin at my blog.

Viewing 5 replies - 1 through 5 (of 5 total)
  • What I would do is to output it like this

    <ul>
    <li>movie 1</li>
    <li>movie 2</li>
    </ul>

    The users, then, need to hardcode the heading themselves

    <h3>My Movies</h3>
    <?php mynetflix(); ?>

    Thread Starter jimmyoliver

    (@jimmyoliver)

    Agreed. So I have mynetflix outputting


    <ul>
    <li>movie 1</li>
    <li>movie 2</li>
    </ul>

    And for kuberick, I added


    <li><h2>MyNetflix Movies</h2>
    <?php mynetflix(); ?>
    </li>

    In the sidebar section of the template..

    Thanks for your input. This should work with any template out there since I am not using any custom css.

    heathert

    (@heathert)

    This is sweet! I’ve been looking for a plug-in like this for a few weeks. Thanks Jimmy!

    davidchait

    (@davidchait)

    Neat approach.

    Someone was using CG-Feedread for the same thing, since it’s just an RSS feed. And then doesn’t depend on Magpie. Just in case anyone is looking for alternate solutions to the same problem.

    -d

    adb

    (@adb)

    After installing the plugin I get the following error:
    Warning: main(/home/site/public_html/wp-content/plugins/mynetflix_inc/magpierss/rss_fetch.inc): failed to open stream: No such file or directory in /home/site/public_html/wp-content/plugins/mynetflix/mynetflix.php on line 14

    Fatal error: main(): Failed opening required ‘/home/site/public_html/wp-content/plugins/mynetflix_inc/magpierss/rss_fetch.inc’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/site/public_html/wp-content/plugins/mynetflix/mynetflix.php on line 14

    Please advise.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Netflix Plugin and a Question’ is closed to new replies.