ICT Bersama Sirman

Random posts for blogger/blogspot

salam en.sirman..cikmin nak tanyer la..camner nak buat random post tu…?eh..soklan camni leh tanyer ke…try je la ek…

kasehabadi.blogspot.com

————————————————————————————————-

Sirman said:

dengan menggunakan tahap tertinggi googling skills, sy berjaya menemui an alternative bagaimana nak buat “Random posts for blogger/blogspot

cth leh tgk kat blog sy atas kiri. gerek dak? 8)

senang jer nak buat, just 2 steps jer:

1. Add a Gadget from your Page Elements (cth gbr bwh).

random1

Pilih HTML/JavaScript & paste code bwh ni:

<div id="extract_output">
</div>

1st gadget ni terpulang kat korang nak letak kat mana, so kat mana u letak kat situ la munculnya random posts tu nanti.

2. add the 2nd Gadget from your Page Elements. Tapi kali ni move gadget tu ke bwh sekali. (cth gbr bwh)

random21

pastu paste code ni lak:

UPDATE 4:30pm

seems that code bwh ni dah mess up, tu yg tak jadik tu :[

so please download dr sini:

http://redmummy.com/downloads/ict_bersama_sirman_random_posts.txt

<script type="text/javascript">
/*<[CDATA[ <!-- */
//Beginning dynamic archive extract code.

//Locate the archive list.
var archive = document.getElementById("ArchiveList");
var archive_html = archive.innerHTML;
var links = [];

var introArray = new Array(
“<br>Have you read ^?”,
“<br>Check out ^.”,
“<br>Looking for something to read?  How about ^.”,
“<br>My blog says: \”Look at ^\”",
“<br>I dredged up an old post just for you: ^”,
“<br>Please look at ^.”,
“<br>I wonder if you’d like to read ^?”,
“<br>You might enjoy reading ^.”,
“<br>Look what I found for you: ^”,
“<br>My blog has a post just for you: ^.”
)

//Now search for child elements that have the class “posts”
//These contain the links that we want to extract.

function random_number(range)
{
return (Math.round(Math.random()*200000)%range);
}

var found_place = archive_html.search(‘<’);

while(found_place!=-1)
{
var extract_string = archive_html.substring(found_place,found_place+10);

//Check to see if we found the beginning of the link section we want.
if(extract_string.localeCompare(“<ul class=”)==0|
extract_string.localeCompare(“<UL class=”)==0)
{
//Found the link list, now go through and extract the links.
var inner_search = archive_html.search(“<”);
if(inner_search==-1)
{
links[links.length]=”(Failed)”;
exit;
}
var loop_flag = true;
while(loop_flag)
{
if(inner_search==-1)
{
exit;
}
else
{
if(archive_html.substring(inner_search,inner_search+5).localeCompare(‘</ul>’)==0|
archive_html.substring(inner_search,inner_search+5).localeCompare(‘</UL>’)==0)
{
//Finished with this archive section so exit.
loop_flag = false;
}
else if(archive_html.substring(inner_search,inner_search+2).localeCompare(‘<a’)==0|
archive_html.substring(inner_search,inner_search+2).localeCompare(‘<A’)==0)
{
//Found a link to extract, now find the end of the link.
var end_link = archive_html.search(“</a>”)+4;
if(end_link==3)  //Returns negative one if fail, so +4 becomes 3.
{
//Must be Internet Exploder, do a capital search.
end_link = archive_html.search(“</A>”)+4;
}
//Do the slice
links[links.length] = archive_html.substring(inner_search,end_link);
}
}
//Cut out opening just found.
archive_html = archive_html.substring(inner_search+1);
//Search again.
inner_search = archive_html.search(‘<’);
}
}

//Trim out the opening we just found.
archive_html = archive_html.substring(found_place+1);
//Search again.
found_place = archive_html.search(‘<’);

}

//Great, now we have a list of links from the archive
//Do something with them.

document.getElementById(“extract_output”).innerHTML =”;
var number_of_links = 5;

for(var counter=0; counter<number_of_links; counter++)
{

var output_string = introArray[random_number(introArray.length)];

output_string = output_string.replace(“^”,links[random_number(links.length)]);

//Pick a random link and put it in the output area.
document.getElementById(“extract_output”).innerHTML += output_string;
}

/* ]]> –> */
</script>

pastu save la & jeng jeng jeng dah siap! :)

kalo nak customize kan leh gak, cam all those sentences tu kan, boleh la tukar mengikut selera masing2.

“<br>Have you read ^?”,
“<br>Check out ^.”,
“<br>Looking for something to read?  How about ^.”,
“<br>My blog says: \”Look at ^\”",
“<br>I dredged up an old post just for you: ^”,
“<br>Please look at ^.”,
“<br>I wonder if you’d like to read ^?”,
“<br>You might enjoy reading ^.”,
“<br>Look what I found for you: ^”,
“<br>My blog has a post just for you: ^.”

then yg ni plak

var number_of_links = 5;

5 = number of random posts yg korang nak, nak buh 18 pun tak de masalah.

k good luck!

*** credits to Random Post Link Addon Script for Blogger

p/s: kalo utk wordpress lak korang kena install plugins Random Posts from here http://rmarsh.com/plugins/random-posts/

Redmummy said: tidak semua ICT Bersama Sirman is appeared in this blog, most of your questions kalo agak2 biasa je sirman akan jawab to your email directly.

Categories : ICT Bersama Sirman

24 Responses to “ICT Bersama Sirman”


Adorable Muslimah Online Boutique
Hurry, Grab affordable & gorgeous Blouses, Tudung, Telekung, Dresses & more for Ramadhan & Raya!!!
Rahsia Batu Hitam
Merungkai rahsia keajaiban Quantum Pendant & Rahsia Jana Pendapatan Pasif RM2280 sebulan!!!
Corporate Gift and Hampers for Ramadhan & Syawal 2010
A time for celebrating, giving and indulging family, friends and business clients!!!
Delicious Cuppies
Homemade, halal & delicious cupcakes, cakes & brownies. Taste It To Believe It!!!
Butik mama & baby - Enriching the living of mama & baby
Persinggahan setempat menjual pakaian wanita & kanak2 terkini dgn harga yg berbaloi-baloi!!!
Advertise here!
With more than 120K unique visits per month!!!
  1. Mrs Safwan Says:

    Aaarghhhh.. .tak jadi pun….

    Reply

  2. ICT Bersama Sirman | StereoPropaganda Says:

    [...] See the rest here:  ICT Bersama Sirman [...]

  3. cikmin Says:

    terima kaseh ye En.Sirman..cikmin try dulu….

    cikmin´s last blog post..Tawaran Hebat Dari AIR ASIA…tunggu apa lagik…(sticky mode entry..sila scroll ke bawah untuk entry baru)

    Reply

  4. A N N Says:

    I tried pun tak jadi – Nadhhhhhh tolong!!!!

    A N N´s last blog post..Shoes entry!

    Reply

  5. CikPuanMuda Says:

    ha’ah.. tak jadik pun… buta IT sungguh saya ini

    CikPuanMuda´s last blog post..Impian kecundang

    Reply

  6. attyfir Says:

    gud info.nanti senang leh torai..

    attyfir´s last blog post..Continued Story..

    Reply

  7. Diana-k Says:

    aiyak..tak jadik aaaaaaaaa bro!
    awat ehh…. :lol:
    Diana-k´s last blog post..#Not so-smart tunnel#

    Reply

  8. strawberi Says:

    tak publish pun tkpe…ehehe..salam

    nk tanya..utk ad large rectangle…katne nk paste code..dh paste mcm2 tmpt kat html code..tk appear2 pun kat blog..
    so far..dh ade 2 leaderboard n skycraper..igt nk tambah large rectangle..tp taktau nk tambah kat ner…blurr dh..tq

    Reply

    ashterix reply on February 24th, 2009:

    @strawberi,

    dah try steps ni http://www.nuffnang.com.my/blogger/blogspot

    Reply

  9. cikmin Says:

    x jadik la pulak…

    cikmin´s last blog post..Tawaran Hebat Dari AIR ASIA…tunggu apa lagik…(sticky mode entry..sila scroll ke bawah untuk entry baru)

    Reply

  10. ashterix Says:

    all,
    ade copy & paste error tadi. so sy dah update post ni.

    sila copy paste balik both codes. kompom jadik! :)

    Reply

    RedMummy reply on February 24th, 2009:

    @ashterix,

    tu arrr
    orang cakap tak caya!

    Reply

    A N N reply on February 24th, 2009:

    @RedMummy,

    takpe Sirman, dont lose hope & be demoralise! Check lagi then teach us again. So jgn layan Desperate Housewives Season 5, tu you KIV dulu until this one dah settle!

    A N N´s last blog post..Shoes entry!

    Reply

    RedMummy reply on February 24th, 2009:

    @A N N,

    our season 5 is almost finished kak :) hehehehehe
    pastu freeeeeee gioler memalam…

    Reply

  11. zizilala Says:

    mcm best jek info ni.. nnt nk try ler.. :)
    zizilala´s last blog post..Pokok Celaka vs M.A.B

    Reply

  12. A N N Says:

    ok done, macam dah boleh even thou halfway je, part ‘var_links’ tu tak buat pasal dah pening. That one I continue later!

    Thanks Hang Sirman!!

    A N N´s last blog post..Shoes entry!

    Reply

  13. cikmin Says:

    tenkiu EN.Sirman ye…. ;)
    cikmin´s last blog post..Tawaran Hebat Dari AIR ASIA…tunggu apa lagik…

    Reply

  14. Fad Ariffin Says:

    yayy! jadik! jadik! tapi… sy tak nak pakai all those sentences tuh, tak nak pakai introArray. Try2 gak tadi buang edit sana sini, at last jadik jugak.

    TQ TQ TQ En. Sirman.. :)
    Fad Ariffin´s last blog post..PGLtM III – PEMENTASAN TERHEBAT!!

    Reply

  15. cikponbopbon Says:

    tahap tertinggi googling skills tuuuuuu
    heeee

    cikponbopbon´s last blog post..The kecik : Daddy

    Reply

  16. strawberi Says:

    waa..tenkiu..tenkiu..tk pasan ade dh kat nuffnang..tq mr ict

    Reply

  17. kui Says:

    wah tq2..nak test sat gi

    kui´s last blog post..dark side vs white side…hiyah p(^^)q

    Reply

  18. NathanKP Says:

    Thank you very much for giving me credit for the script. I hope that it can be of use to everyone!

    Nathan – Inkweaver Review

    NathanKP´s last blog post..One Year Anniversary of Inkweaver Review

    Reply

  19. Dylan Says:

    kalau nak buat ’similar posts’ selepas every entry sirman tau tak?
    Dylan´s last blog ..My First DSLR! Canon 1000D My ComLuv Profile

    Reply

    RedMummy reply on November 1st, 2009:

    @Dylan,

    dylan submit kat Contact Red pls
    sirman will assist you from there

    Reply

Leave a Reply

CommentLuv Enabled
:p 8) :lol: =( :8 ;) :(( :o: :[ :) :D :-| :-[) :bloody: :cool: :choler: :love: :oups: :aie: :beurk:


Random Red Reddies [ Warung Hotmama ][ Pu3 Mawar ][ Yuyu ][ Maxis iPhone 3G ][ JD ]
RED Random Posts. Korang dah baca?