[JESSE] RSS Parser / Loader

Gestart doorOne2xs28 reacties29 weergaven

29 berichten · pagina 1 van 2

One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Hoi,
ik ben van plan om wat scriptjes te gaan maken die makkelijk te gebruiken zijn en ook zeer handig.

Mijn eerste script word een RSS Parser / Loader.
Vroeger was ik altijd opzoek naar een goede RSS Parser / Loader waarmee ik heel simpel de titel uit een RSS feed kan halen maar ik kon nergens een goed script vinden, of ze waren té uitgebreid of ze werkte niet.
Vandaar dat ik mijn scriptje nu met jullie deel smile
VOORBEELD: http://s01.jessereitsma.nl/scripts/rss/v1.php

SCRIPT:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/* 
 * RSS Loader
 * 
 * (c) Copyright JesseReitsma.nl
 * Dinsdag 21 Februari 2012
 * info@jessereitsma.nl
 * http://www.jessereitsma.nl
 * 
 * Dit script is gratis vrijgegeven voor gebruik
 * Het is niet toegestaan dit script te delen onder je eigen naam zonder toestemming van Jesse Reitsma
 * 
 * [CSS] .nieuwsItems: De class waar alle berichten in staan
 * [CSS] .nieuwsItem: De class voor elk item
 * [CSS] #nieuws_xx: Het ID voor elk nieuws bericht, waar elk nieuws bericht een uniek ID heeft (xx)
 * [CSS] .nieuwsLink: Voor het stylen van de links
 * [CSS] .nieuwsLinkTwitter: Voor het stylen van de Twitter link
 * [CSS] .nieuwsTwitter: Image stylen (Tweet button)
 * 
 * UPDATE: Twitter functie -> gebruik RSS(feed, twitternaam); om achter elk nieuws bericht een tweetbutton te zetten voor gebruikers!
 */[/COLOR]    
[COLOR= #007700]function[/COLOR] tagASvalue[COLOR= #007700]([/COLOR][COLOR= #0000BB]$waardeItems[/COLOR][COLOR= #007700]) {[/COLOR] 
    [URL="http://www.php.net/for"]for[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]<[/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$waardeItems[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++) {[/COLOR] 
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$waardeItems[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]value[/COLOR][COLOR= #007700]])) {[/COLOR] 
            [COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$waardeItems[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]tag[/COLOR][COLOR= #007700]]] =[/COLOR] [COLOR= #0000BB]$waardeItems[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]value[/COLOR][COLOR= #007700]]; 
        } 
    }[/COLOR] 
    [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700]; 
}
function[/COLOR] RSS[COLOR= #007700]([/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$twitter[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700]) {[/COLOR]
    [COLOR= #0000BB]$xml_parser[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/xml_parser_create"]xml_parser_create[/URL][COLOR= #007700]();[/COLOR] 
    [COLOR= #0000BB]$implode[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/implode"]implode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000][/COLOR][COLOR= #007700],[/COLOR] [URL="http://www.php.net/file"]file[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700]));[/COLOR] 
    [URL="http://www.php.net/xml_parser_set_option"]xml_parser_set_option[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$xml_parser[/COLOR][COLOR= #007700],[/COLOR] XML_OPTION_SKIP_WHITE[COLOR= #007700],[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR] 
    [URL="http://www.php.net/xml_parser_set_option"]xml_parser_set_option[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$xml_parser[/COLOR][COLOR= #007700],[/COLOR] XML_OPTION_CASE_FOLDING[COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR] 
    [URL="http://www.php.net/xml_parse_into_struct"]xml_parse_into_struct[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$xml_parser[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$implode[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$waarde[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$items[/COLOR][COLOR= #007700]);[/COLOR] 
    [URL="http://www.php.net/xml_parser_free"]xml_parser_free[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$xml_parser[/COLOR][COLOR= #007700]);[/COLOR] 
    [URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$items[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$key[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$waarde2[/COLOR][COLOR= #007700]) {[/COLOR] 
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$key[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]item[/COLOR][COLOR= #007700]) {[/COLOR]
            [COLOR= #0000BB]$waarde3[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$waarde2[/COLOR][COLOR= #007700];[/COLOR] 
            [URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]<[/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$waarde3[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]+=[/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700]) {[/COLOR] 
                [COLOR= #0000BB]$item2[/COLOR][COLOR= #007700][] =[/COLOR] tagASvalue[COLOR= #007700]([/COLOR][URL="http://www.php.net/array_slice"]array_slice[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$waarde[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$waarde3[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]]+[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$waarde3[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]+[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]]-[/COLOR][COLOR= #0000BB]$waarde3[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]]+[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700])); 
            } 
        } 
    }[/COLOR] 
    [COLOR= #0000BB]$item[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$item2[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<span class="nieuwsItems">[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]<[/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++) {[/COLOR] 
        [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<span class="nieuwsItem" id="nieuws_[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]">[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<a class="nieuwsLink" target="_new" href="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]link[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]">[/COLOR][COLOR= #007700];[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</a>[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #FF8000]/* Twitter functie */[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$twitter[/COLOR][COLOR= #007700]) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<a class="nieuwsLinkTwitter" target="_new" href="https://twitter.com/intent/tweet?original_referer=http://[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]HTTP_HOST[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000][/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"PHP_SELF"[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]&source=tweetbutton&text=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]&url=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]link[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]&via=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$twitter[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"><img class="nieuwsTwitter" src="https://si0.twimg.com/a/1329497727/images/logos/twitter_newbird_blue.png" height="16" width="16" /></a>[/COLOR][COLOR= #007700];
            }[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</span>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];
    }[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</span>[/COLOR][COLOR= #007700];
}[/COLOR]
RSS[COLOR= #007700]([/COLOR][COLOR= #DD0000]"http://www.nu.nl/feeds/rss/internet.rss"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"JesseReitsma"[/COLOR][COLOR= #007700]);[/COLOR] 
?>


In het voorbeeld staat de Twitter functie aan, dit houd in als de Twitter functie aan staat dat je achter elk nieuws item een Twitter icoontje ziet staan als je daar op klikt opent er een Twitter scherm met [titel] via @[twitternaam]

Om het zonder Twitter te gebruiken haal je heel simpel je je Twitternaam (In dit geval JesseReitsma) weg zodat je RSS("link", ""); hebt of gewoon RSS("link");

Vragen, problemen, foutjes, opmerkingen, tips, dreigementen kunnen in dit topic geplaatst worden of via PB / email: info@jessereitsma.nl

Je roept het dus zo aan:

RSS("http://www.nu.nl/feeds/rss/internet.rss", "JesseReitsma");
Waarbij de eerste parameter je RSS feed is, en de 2e parameter je Twitter account (Niet verplicht)

Wat er nog op mijn lijstje staat:
- Uitgebreide AJAX Chatbox
- AJAX Berichtenbalk
- Poll

Ik kan daar vandaag helaas niet aan werken aangezien de databases van mijn oude server nog niet volledig zijn overgeplaatst naar mijn nieuwe server (Ik host alles thuis)
En aangezien ik nu op kantoor ben en mijn oude webserver uit staat thuis, kan ik dus ook niet bij die databases nooo
UPDATE DINSDAG 21 FEBRUARI 21:08
Na aanleiding van dit bericht:
Robertt schreef:
Met deze is niet mogelijk om het bericht ook te lezen hé?
Ben ik aan de slag gegaan, met de onderstaande code krijg je de headlines, en als je er op klikt met jQuery.toggle(); word de beschrijving geopend, met een link naar het hele bericht:
Spoiler tonen
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/* 
 * RSS Loader
 * 
 * (c) Copyright JesseReitsma.nl
 * Dinsdag 21 Februari 2012
 * info@jessereitsma.nl
 * http://www.jessereitsma.nl
 * 
 * Dit script is gratis vrijgegeven voor gebruik
 * Het is niet toegestaan dit script te delen onder je eigen naam zonder toestemming van Jesse Reitsma
 * 
 * [CSS] .nieuwsItems: De class waar alle berichten in staan
 * [CSS] .nieuwsItem: De class voor elk item
 * [CSS] #nieuws_xx: Het ID voor elk nieuws bericht, waar elk nieuws bericht een uniek ID heeft (xx)
 * [CSS] .nieuwsLink: Voor het stylen van de links
 * [CSS] .nieuwsLinkTwitter: Voor het stylen van de Twitter link
 * [CSS] .nieuwsTwitter: Image stylen (Tweet button)
 * 
 * UPDATE: Twitter functie -> gebruik RSS(feed, twitternaam); om achter elk nieuws bericht een tweetbutton te zetten voor gebruikers!
 */[/COLOR]    

[COLOR= #007700]function[/COLOR] tagASvalue[COLOR= #007700]([/COLOR][COLOR= #0000BB]$waardeItems[/COLOR][COLOR= #007700]) {[/COLOR] 
    [URL="http://www.php.net/for"]for[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]<[/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$waardeItems[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++) {[/COLOR] 
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$waardeItems[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]value[/COLOR][COLOR= #007700]])) {[/COLOR] 
            [COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$waardeItems[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]tag[/COLOR][COLOR= #007700]]] =[/COLOR] [COLOR= #0000BB]$waardeItems[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]value[/COLOR][COLOR= #007700]]; 
        } 
    }[/COLOR] 
    [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700]; 
}
function[/COLOR] RSS[COLOR= #007700]([/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$twitter[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700]) {[/COLOR]
    [COLOR= #0000BB]$xml_parser[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/xml_parser_create"]xml_parser_create[/URL][COLOR= #007700]();[/COLOR] 
    [COLOR= #0000BB]$implode[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/implode"]implode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000][/COLOR][COLOR= #007700],[/COLOR] [URL="http://www.php.net/file"]file[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700]));[/COLOR] 
    [URL="http://www.php.net/xml_parser_set_option"]xml_parser_set_option[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$xml_parser[/COLOR][COLOR= #007700],[/COLOR] XML_OPTION_SKIP_WHITE[COLOR= #007700],[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR] 
    [URL="http://www.php.net/xml_parser_set_option"]xml_parser_set_option[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$xml_parser[/COLOR][COLOR= #007700],[/COLOR] XML_OPTION_CASE_FOLDING[COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR] 
    [URL="http://www.php.net/xml_parse_into_struct"]xml_parse_into_struct[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$xml_parser[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$implode[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$waarde[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$items[/COLOR][COLOR= #007700]);[/COLOR] 
    [URL="http://www.php.net/xml_parser_free"]xml_parser_free[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$xml_parser[/COLOR][COLOR= #007700]);[/COLOR] 
    [URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$items[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$key[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$waarde2[/COLOR][COLOR= #007700]) {[/COLOR] 
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$key[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]item[/COLOR][COLOR= #007700]) {[/COLOR]
            [COLOR= #0000BB]$waarde3[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$waarde2[/COLOR][COLOR= #007700];[/COLOR] 
            [URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]<[/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$waarde3[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]+=[/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700]) {[/COLOR] 
                [COLOR= #0000BB]$item2[/COLOR][COLOR= #007700][] =[/COLOR] tagASvalue[COLOR= #007700]([/COLOR][URL="http://www.php.net/array_slice"]array_slice[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$waarde[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$waarde3[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]]+[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$waarde3[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]+[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]]-[/COLOR][COLOR= #0000BB]$waarde3[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]]+[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700])); 
            } 
        } 
    }[/COLOR] 
    [COLOR= #0000BB]$item[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$item2[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<span class="nieuwsItems">[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]<[/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++) {[/COLOR] 
        [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<span class="nieuwsItem" id="nieuws_[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]">[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<a class="nieuwsLink" target="_new" onClick="$(#nieuwsItemFull_[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]).toggle(slow);">[/COLOR][COLOR= #007700];[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</a>[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #FF8000]/* Twitter functie */[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$twitter[/COLOR][COLOR= #007700]) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<a class="nieuwsLinkTwitter" target="_new" href="https://twitter.com/intent/tweet?original_referer=http://[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]HTTP_HOST[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000][/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"PHP_SELF"[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]&source=tweetbutton&text=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]&url=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]link[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]&via=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$twitter[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"><img class="nieuwsTwitter" src="https://si0.twimg.com/a/1329497727/images/logos/twitter_newbird_blue.png" height="16" width="16" /></a>[/COLOR][COLOR= #007700];
            }[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</span>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div id="nieuwsItemFull_[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" style="display: none;">[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]description[/COLOR][COLOR= #007700]];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<a class="nieuwsLink" target="_new" href="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]link[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]">Lees het hele bericht &raquo;</a>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</div>[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];
    }[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</span>[/COLOR][COLOR= #007700];
}[/COLOR]
RSS[COLOR= #007700]([/COLOR][COLOR= #DD0000]"http://www.nu.nl/feeds/rss/internet.rss"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"JesseReitsma"[/COLOR][COLOR= #007700]);[/COLOR] 
?>
VOORBEELD V2: [URL="http://s01.jessereitsma.nl/scripts/rss/v2.php"]http://s01.jessereitsma.nl/scripts/rss/v2.php
0
Berichten
5.498
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Leuk gemaakt, mijn complimenten biggrinOok aardig van je dat je het gratis weggeeft smile
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ziet er echt netjes uit.
Ik moet ook eens een keer me gaan verdiepen in het diepere PHP zoals classes enz.

Netjes dat je het vrijgeeft ook wink
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Er komt nog een uitgebreide chat aan, niet OOP maar dat komt omdat er alleen php bevind in een ajax bestand zegmaar.

@gamedealer, je mag me helpen met de chat als je wilt? smile
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Xjessex schreef:
Er komt nog een uitgebreide chat aan, niet OOP maar dat komt omdat er alleen php bevind in een ajax bestand zegmaar.

@gamedealer, je mag me helpen met de chat als je wilt? smile
Ik help je graag, maar ik heb er helaas geen tijd voor.sadley
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Okay, jammer smile
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Mooie rss loader. Misschien dat ik hem is ga gebruiken smile
Btw; Misschien kon je beter er een class van maken.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Uhu, alleen ben ik daar nog niet echt goed in daarom zijn het gewoon 2 losse functions ;d
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Een bestand vol met handige functies lijkt me leuk.

Een kip kan niet "boe" zeggen redface
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Met deze is niet mogelijk om het bericht ook te lezen hé?
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Vriendje schreef:
Een bestand vol met handige functies lijkt me leuk.

Een kip kan niet "boe" zeggen redface
Zoals?
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Robertt schreef:
Met deze is niet mogelijk om het bericht ook te lezen hé?
Hier kan je juist RSS-feeds mee uitlezen...
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Eerdere citaten tonen
Robertt schreef:
Met deze is niet mogelijk om het bericht ook te lezen hé?
Hier kan je juist RSS-feeds mee uitlezen...
Ja had het niet goed gezien, ga zelf is beetje werken aan dit script dat je RSS("http://www.nu.nl/feeds/rss/internet.rss", titel, "JesseReitsma"); ofzo iets kan doen.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Robertt schreef:
Met deze is niet mogelijk om het bericht ook te lezen hé?
Kijk de update, code is niet gehightlight en ook spoiler werkt niet, even topic aanmaken in bug categorie.. nooo
toevoeging op 21 februari 2012, 211606:
Laat maar, werkt alweer biggrin
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Xjessex schreef:
Eerdere citaten tonen
Robertt schreef:
Met deze is niet mogelijk om het bericht ook te lezen hé?
Kijk de update, code is niet gehightlight en ook spoiler werkt niet, even topic aanmaken in bug categorie.. nooo
toevoeging op 21 februari 2012, 211606:
Laat maar, werkt alweer biggrin
Leuk gemaakt biggrin
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren