Is there anyway to random the blog in this forum DP

Discussion in 'Support & Feedback' started by TheSyndicate, Oct 16, 2006.

  1. #1
    Is there anyway to random the blog in this forum DP

    I want to random my blogs i have so many.

    i did a small php script that redirect the url but that did not work.

    www.yellowberry.org/digital.php

    Anyone?:p
     
    TheSyndicate, Oct 16, 2006 IP
    Smyrl likes this.
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #2
    T0PS3O, Oct 16, 2006 IP
  3. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #3
    I do not know squat about it or at least i can not make code with it.
    Any code i can snitch ?

    Please give me a code ;)
     
    TheSyndicate, Oct 16, 2006 IP
  4. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Something like this (not tested):

    
    $random = rand(0, 3);
    if ($random == 0) {
    $content = file_get_content('http://www.site1.com/feed.xml');
    } elseif ($random == 1) {
    $content = file_get_content('http://www.site2.com/feed.xml');
    } elseif ($random == 2) {
    $content = file_get_content('http://www.site3.com/feed.xml');
    } elseif ($random == 3) {
    $content = file_get_content('http://www.site4.com/feed.xml');
    }
    
    echo $content;
    
    PHP:
     
    T0PS3O, Oct 16, 2006 IP
  5. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #5
    Ok i will check it out i hope it works :)
     
    TheSyndicate, Oct 16, 2006 IP
  6. montrio_c

    montrio_c Guest

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hello i am working for yellowberry and this is my code but it not work www.yellowberry.org/digital.php

    <?
    $random = rand(0, 1);
    if ($random == 0) {
    $content = file_get_content('http://www.googleandme.com/feed');
    }
    elseif ($random == 1) {
    $content = file_get_content('http://www.personalthailand.com/feed');
    }
    echo $content;
    ?>
     
    montrio_c, Oct 16, 2006 IP
  7. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #7
    I think you guys are overcomplicating it... $feeds is an array of any number of blog feeds...

    <?php
    	$feeds = array ('http://www.winn-and-sims.com/atom.xml', 'http://www.auction-registration.com/atom.xml', 'http://www.shawnhogan.com/feed/');
    	readfile ($feeds[array_rand($feeds)]);
    ?>
    PHP:
     
    digitalpoint, Oct 16, 2006 IP
    TheSyndicate and gemini181 like this.
  8. gemini181

    gemini181 Well-Known Member

    Messages:
    2,883
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    155
    #8
    If I modify your code like this: first make the variable 'sites'

    <?php $sites = ...

    Then I use url's ending with 'site.com/webpage.html'

    Will this exact code, with my 'mod' work to call up one random page from a list of URL's?

    Thanks.
     
    gemini181, Oct 17, 2006 IP
  9. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #9
    Look ok when i enter it. My webguy is working with it now thank you so much. I gave you some green but i do not think you need it you are sweet enough.

    Yep i got DP blogs in my post now lets my works as well
     
    TheSyndicate, Oct 17, 2006 IP
  10. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #10
    TheSyndicate, Oct 17, 2006 IP
  11. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Not all of us spoke our first words as "echo 'hello world';" (including the echo).
     
    T0PS3O, Oct 17, 2006 IP
  12. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #12
    Fine, fine... I guess that's why I'm a coder and not uhm... something else.
     
    digitalpoint, Oct 17, 2006 IP
  13. hextraordinary

    hextraordinary Well-Known Member

    Messages:
    2,171
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    105
    #13
    Wouldn't Header - ing it to the URL be better than readfile in this case?
     
    hextraordinary, Oct 17, 2006 IP
  14. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #14
    No, not everything follows redirects.
     
    digitalpoint, Oct 17, 2006 IP
  15. hextraordinary

    hextraordinary Well-Known Member

    Messages:
    2,171
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    105
    #15
    ummm.... In what case using Header not work?
     
    hextraordinary, Oct 17, 2006 IP
  16. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #16
    If the process fetching the feeds doesn't follow redirects.
     
    digitalpoint, Oct 17, 2006 IP
  17. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #17
    thanks Shawn its working now :)
     
    TheSyndicate, Oct 17, 2006 IP
  18. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #18
    I put another blog and not it does not work my web guy is scratching his head i need help

    <?php
    $feeds = array ('http://www.googleandme.com/feed/', 'http://feeds.feedburner.com/personalthailand/', 'http://feeds.feedburner.com/bangkoksexy/');
    readfile ($feeds[array_rand($feeds)]);
    ?>

    this is my url i get

    http://www.yellowberry.org/digital.php

    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


    --------------------------------------------------------------------------------

    Access is denied. Error processing resource 'http://feeds.feedburner.com/~d/styles/rss2full.xsl'.
     
    TheSyndicate, Nov 5, 2006 IP
  19. Abhik

    Abhik ..:: The ONE ::..

    Messages:
    11,337
    Likes Received:
    606
    Best Answers:
    0
    Trophy Points:
    410
    Digital Goods:
    2
    #19
    ahmmm...
    can you please explain it a bit more? I mean the process? I have four blogs.
    do I have to creat a php file of this code?
    I simply have NO knowlegde of coading :(
     
    Abhik, Nov 6, 2006 IP
  20. ViciousSummer

    ViciousSummer Ayn Rand for President! Staff

    Messages:
    3,210
    Likes Received:
    526
    Best Answers:
    0
    Trophy Points:
    308
    #20
    1. Create a PHP file using this code:

    <?php
    	$feeds = array ('http://www.yourblog.com/atom.xml', 'http://www.yourotherblog.com/atom.xml', 'http://www.yetanotherblog.com/feed/');
    	readfile ($feeds[array_rand($feeds)]);
    ?>
    PHP:
    2. Replace code in red with your blog feeds.

    3. Upload PHP file you created to your host.

    4. At this forum, under your UserCP -> Edit Options -> Blog XML Feed URL, enter the URL of where the PHP file is located.
     
    ViciousSummer, Nov 6, 2006 IP
    gemini181 likes this.