Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Variables in echo statement with array.

    I'm trying the following PHP in a wordpress page template and not having too much luck. Ideally it should output a H2 with Twitter + the page title and then the 10 last posts on twitter related to the page title. I am guessing cause its an echo.

    Code:
      
    <h2><a rel="nofollow" href="http://www.twitter.com">Twitter <?php the_title(); ?> </a></h2>
                            <ul>
                            <?php
                            echo SimplePieWP('http://search.twitter.com/search.atom?q=<?php the_title(); ?>
    ', array(
                                'items' => 10,
                            ));
                            ?>
                            </ul>
    Anyone ?

  • #2
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,547
    Thanks
    57
    Thanked 148 Times in 147 Posts
    id have to see the functions but this should help

    PHP Code:
    <?php echo SimplePieWP("http://search.twitter.com/search.atom?q=".the_title(), array("items" => 10)); ?>
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #3
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Phil,

    I dropped that in and it didnt work.

    What functions do you need to see ?

    Whats good to debug ? or see errors ?

    Benjamin

  • #4
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    All it is outputting now is the title. Any other syntax ?

    Benjamin
    Last edited by chefben; 09-22-2009 at 11:21 AM. Reason: added text

  • #5
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,547
    Thanks
    57
    Thanked 148 Times in 147 Posts
    i need to know what this function does: SimplePieWP(); and the_title();
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #6
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Its a Wordpress site.

    So, the_title(); pulls the Page Title &

    SimplePieWP(); see;

    http://simplepie.org/wiki/plugins/wo...rev=1182456212

    Is that what you need ?

  • #7
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,547
    Thanks
    57
    Thanked 148 Times in 147 Posts
    see i dont use word press.
    I need to know what this function does to know how to help you.

    PHP Code:
    SimplePieWP($addressOrSomeSort$andThisIsSomething); 
    Do you understand what i mean?
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #8
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,547
    Thanks
    57
    Thanked 148 Times in 147 Posts
    PHP Code:
    <?php 
    echo SimplePieWP("http://search.twitter.com/search.atom?q=".the_title(), array('items' 10)); 
    ?>

    should limit the number of posts returned to 10.
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #9
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yeah on the link under parameters about half way down.

    http://simplepie.org/wiki/plugins/wo...rev=1182456212

  • #10
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok I got it displaying now using, this..... but its not right. its now searching .the_title() instead of the name of the page.

    Code:
    <?php echo SimplePieWP('http://search.twitter.com/search.atom?q=.the_title()', array("items" => 10)); ?>

  • #11
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    just tried another RSS feed and it too is displaying feeds with "title" in them

  • #12
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,547
    Thanks
    57
    Thanked 148 Times in 147 Posts
    try (copy and paste)
    PHP Code:
    <?php 
    $title 
    the_title();
    echo 
    SimplePieWP("http://search.twitter.com/search.atom?q=$title"
    array(
    'items' 10));
    ?>
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #13
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i actually just worked it out in the end. thanks for all your help Phil.


    Code:
     <?php echo SimplePieWP (array(
    'http://search.twitter.com/search.atom?q=' . urlencode ( the_title ( '' , '' , false ) ) . ''
    ),array( 'items' => '6' )); ?>


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •