1. Halo Guest, pastikan Anda selalu menaati peraturan forum sebelum mengirimkan post atau thread baru.

[Share] PHP Spinner

Discussion in 'Pemrograman Web' started by xrvel, Apr 12, 2011.

Tags:
  1. xrvel

    xrvel Super Hero

    Joined:
    Oct 21, 2007
    Messages:
    2,873
    Likes Received:
    947
    Location:
    Di sini
    Ini adalah salah satu kode PHP spinner yg saya dapat dari google
    PHP:
    <?php
    function spin($text) {
        
    //While there's pairs of square brackets, spin whats inside of them
        
    while (!(strpos($text,'{') === FALSE) && !(strpos($text,'}') === FALSE)) {
            
    //Find the first '['
            
    $leftb strpos($text,'{');

            
    //Find the first ']'
            
    $rightb strpos($text,'}');

            
    //Split the string up, then (psudo)randomise the item chosen
            
    $spintext explode('|',substr($text,$leftb+1,$rightb-$leftb-1));
            
    $spinselect trim($spintext[mt_rand(0,count($spintext)-1)]);

            
    //Get the whole string to replace including the brackets
            
    $brackettext substr($text,$leftb,($rightb-$leftb)+1);

            
    //Replace the [blah,blah2] with whatever item is chosen
            
    $text str_replace($brackettext,$spinselect,$text);
        }
        
    //return the block of modified text
        
    return $text;
    }
    ?>
    Cara pakai tinggal kaya gini :
    PHP:
    <?php
    echo spin('Hello {mom|dad|sis} {how are you|hello there} !!');
    ?>
    Sumber :
    Code:
    http://www.kythin.com/free-php-spinner/
    • Kode ini mewajibkan sintaks penulisan yg benar (kalo ada kurung buka harus ada kurung tutupnya)
    • Kode ini belum support spinner di dalam spinner contoh
      Code:
      {{beautiful|pretty} mom|dad|sister}
    • Contoh spinner yg lebih rumit & powerful bisa dicek di sini
      Code:
      http://www.paul-norman.co.uk/2010/09/php-spinner-updated-spin-articles-for-seo/
     
    Last edited: Apr 12, 2011
    adexaja, Schwarzkophf and newbisa like this.
  2. newbisa

    newbisa I'm Blogger Lovers

    Joined:
    Dec 13, 2010
    Messages:
    2,417
    Likes Received:
    539
    Location:
    DigitalJV.com
    nice share gan,..

    perlu dicoba :D
     
  3. Schwarzkophf

    Schwarzkophf Super Hero

    Joined:
    Nov 13, 2008
    Messages:
    2,318
    Likes Received:
    71
    Location:
    Depok
    gile ..
    mantab om xrvel :lovekiss:
     
  4. gecko

    gecko Ads.id Pro

    Joined:
    Apr 23, 2010
    Messages:
    315
    Likes Received:
    164
    Location:
    http://gecko.web.id
    dictionarynya yang sulit....
    mungkin nanti saya yg gantian share spinner + dictionarynya....
     
  5. ellabram

    ellabram Super Hero

    Joined:
    Oct 23, 2007
    Messages:
    1,293
    Likes Received:
    42
    Location:
    SBY - BDG
    mantab ... ditunggu dictionarynya pren
     
  6. gecko

    gecko Ads.id Pro

    Joined:
    Apr 23, 2010
    Messages:
    315
    Likes Received:
    164
    Location:
    http://gecko.web.id
    Sementara ini dulu buatan bro desrizal.

    DEMO
    Code:
    http://www.thestuffreview.com/articel-rewrite.html
    
    DOWNLOAD
    Code:
    http://blog.codingwear.com/lab/articel-rewriter.zip
    
     
    xrvel likes this.
  7. exzant

    exzant Super Hero

    Joined:
    Dec 21, 2009
    Messages:
    2,284
    Likes Received:
    455
    Location:
    Solo ›› Jogja
  8. xrvel

    xrvel Super Hero

    Joined:
    Oct 21, 2007
    Messages:
    2,873
    Likes Received:
    947
    Location:
    Di sini
    Fungsinya memang sama yaitu untuk spinner, tapi kode utamanya beda :)

    Kode yg ini mengharuskan semua kurung buka harus ditutup, kalo nggak error.
    Kalo kode bro exzant kurung tidak ditutup nggak apa2. :) (karena memang sistemnya hanya explode)

    Plus saya nggak bilang kode ini saya yg buat kok tapi saya nemu di blog ini
    Code:
    http://www.kythin.com/free-php-spinner/

    Nice... ini sistemnya gmana bro? pake file dictionary utk replace sinonim? :kembang:
     
    Last edited: Apr 12, 2011
  9. gecko

    gecko Ads.id Pro

    Joined:
    Apr 23, 2010
    Messages:
    315
    Likes Received:
    164
    Location:
    http://gecko.web.id
    iya, dictionarynya disimpen di mysql
     
  10. c4lv1n

    c4lv1n Ads.id Fan

    Joined:
    Apr 9, 2011
    Messages:
    135
    Likes Received:
    184
    itu plugin ya mas? soalnya disimpen dalam bentuk zip gitu, jd critanya bs aku upload ke wp-content/plugins, terus nanti sinonim2 aku masukin aja di SQL file sinonim (menambah 50 list sinonim yang sudah ada)??

    udh betulkah? tolong diajarin dong :nangis2:
     
  11. adexaja

    adexaja :3

    Joined:
    Oct 21, 2010
    Messages:
    3,305
    Likes Received:
    623
    Location:
    Musholla
    Sinonim nya musti cari sendiri kah ? Ajari ane donk tentang masukkan dictionary ke mysql.
     
  12. c4lv1n

    c4lv1n Ads.id Fan

    Joined:
    Apr 9, 2011
    Messages:
    135
    Likes Received:
    184
    dijawab dong master2 yang ada disini :)
     
  13. gecko

    gecko Ads.id Pro

    Joined:
    Apr 23, 2010
    Messages:
    315
    Likes Received:
    164
    Location:
    http://gecko.web.id
    bukan plugin....
    stand alone apps

    kalo plugin buatan ane coba
    HTML:
    http://www.adsense-id.com/forums/showthread.php/45961-memperkenalkan-AcaAca-gt-gt-WP-Plugin-content-uniquefier?highlight=
    
     
  14. webee

    webee Newbie

    Joined:
    Jun 14, 2011
    Messages:
    22
    Likes Received:
    0
    wah lumayan nih buat nyepin deskiprsi kecil kecilan, thanks gan :D
     
  15. teukualamsyah

    teukualamsyah Super Hero

    Joined:
    Nov 28, 2010
    Messages:
    1,245
    Likes Received:
    56
    Location:
    Bengkoeloe, Bengkulu, Indonesia, Indonesia
    supaya bisa jalankan ini gimana gan?
    PHP:
    echo spin('<b><?php echo $title?> -</b> {Welcome|Encouraged|Pleasant|Delightful|Allowed} {to|in order to|to be able to|for you to|to help} {my|my personal|my own|our|the} {blog|weblog|website|website|blog site|blog}, {in this|with this|on this|within this|in this particular} {time|period|moment|occasion|time period} {I'll|I will|I am going to|I'm going to|We'll} {show you|demonstrate|explain to you|teach you|provide you with} {about|regarding|concerning|with regards to|in relation to} {{keyword}}. {And now|And today|Now|And after this|And from now on}, {this is the|this is actually the|here is the|this can be a|this can be the} {first|very first|initial|1st|primary} {image|picture|graphic|impression|photograph}');
    gak mau jalan karena ada kode ini <b><?php echo $title; ?> -</b>
    karena ada kata ini juga I'll (tanda kutip satu)
    dan kode ini {{keyword}}

    tolong bantuannya gan.
     
  16. Roy Jono

    Roy Jono Ads.id Starter

    Joined:
    Dec 26, 2017
    Messages:
    65
    Likes Received:
    1
    wah lumayan banget nih infonya..makasih ya gan..
     
  17. niamnungil

    niamnungil Banned

    Joined:
    Jul 20, 2017
    Messages:
    976
    Likes Received:
    441
    Location:
    Di balik Awan
    jejak gan
     

Share This Page