sunscreen2

Sunčanje ili ne – odlučite sami!

Svaka priprema za more, jezero ili bazen (ili samo sunčanje kod kuće) pored pripreme kupaćeg kostima, peškira i ostalih sitnica, obuhvata i odabir adekvatnog preparata za zaštitu prilikom sunčanja. Pri ...

Slika dana: Supermesec [12.07.2014]

(super)Mesec 2014 - prvi put [12.07.2014]

Supermesec Credit: From Quark to Quasars Večeras je pun Mesec, ali ne običan već supermesec! U astronomskom smislu pojam "supermesec" nema neko posebno značenje ali ova pojava je u javnosti (i medijima) vrlo ...

DMN_3491

Inovativni sistem eko rasvete na PMF-u u Nišu

Niš, 19. jun 2014. – Studentski tim „Eko-rasveta“ predstavio je inovativni sistem ekološke rasvete na Prirodno-matematičkom fakultetu u Nišu. Sa idejom da se prednosti novih tehnologija primene u svrhu ekološke ...

coffe_by_natasha555-d3eugg0

Od šoljice kafe do olujnog oblaka i nazad

Jako nevreme i katastrofalne poplave koje su sredinom maja pogodile našu zemlju izazvale su ogromnu materijalnu štetu, ali iz ogromne vode "isplivale" su i različite priče i pretpostavke o mogućem veštačkom uticaju na ...

Slika dana: Rodjendan [01.06.2014]

Svet nauke slavi sedmi rođendan [01.06.2014]

"Svet nauke" - 7 godina rada Fotografija: Microspace in Canada Pre tačno sedam godina, 1. juna 2007. godine počeo je da radi blog "O životu, univerzumu i svemu ostalom", koji je kasnije ...

HAARP20l

Šta je HAARP sistem i da li je povezan sa promenom vremenskih prilika?

High Frequency Active Auroral Reseach Program (Visokofrekventni program za aktivno istraživanje aurore) set je antena koje emituju visoko frekventno (HF) radio zračenje. Ove antene koje se nalaze kraj Gakona na ...

Home > IT > Moj prvi WordPress plugin: MM-Breaking News

Moj prvi WordPress plugin: MM-Breaking News

March 6th, 2009

Danas sam završio moj prvi WordPress plugin :) Posle… hm, oko deset godina “zaboravljanja” programiranja u poslednjih mesec dana odlučio sam da malo obnovim staru zavisnost (DA, zavisnost ali u mom slučaju izlečena…. valjda :)

Plugin je inicijalno napisan za potrebe sajta Southeaster European Network in Mathematical and Theoretical Physics - SEENET-MTP (sajt je još uvek u izradi). Namena plagina je da omogući prikazivanje naslova najvažnijih vesti, najava (za konferencije, na tom sajtu) itd.

Kako izgleda, možete da vidite ovde na naslovnoj strani – ispod menija. Možete da birate koliko će nezavisnih listi biti prikazano, koje kategorije treba uključiti a koje izbaciti iz liste, da li postove tekstove sortirati hronološki ili slučajno. Uz naslov je moguće dodati i broj komentara i datum objavljivanja. Tu je i mogućnost izbora da li se lista prikazuje samo na naslovnoj strani ili svuda na sajtu. Mesto gde se plugin prikazuje na stranici je takođe moguće izabrati.

Ovako izgleda podešavanje plugina:

MM-Breaking News - Administration

Ako hoćete da probate, plugin možete da preuzmete ovde. Naravno, kad naiđete na grešku ili problem javite da ispravljam :)

Imam još neke kvazi-pluginove  (za organizaciju registrovanih članova, mini-povezivanje sa Mailman-om, e-mail serverom, kontrolu pristupa tekstvima i RSSu, automatskogenerisanje sadržaja) ali… daleko su od bezbedne faze :)

avatar

Autor: Milan Milošević

Urednik i vlasnik sajta. Diplomirao fiziku, a sada je student doktorskih studija i istraživač-pripravnik na Prirodno matematičkom fakultetu u Nišu. Najviše ga interesuje astrofizika, kosmologija i inflacija, a najveći deo svog slobodnog vremena posvećuje popularizaciji i približavanju nauke mladima. Dugogodišnji borac za razotkrivanje astrolagarija i ostalih kvazinauka na Internetu, i šire. (Kontakt, Biografija))

Categories: IT

Najnoviji tekstovi

Otvaranje prvog Makers Lab-a u Srbiji

Svet nauke 23.11.2014
Makers Lab pozivnica Nakon više stotina naučnopopularnih događaja širom Srbije, tačno na svoj četvrti rođendan, Centar za promociju nauke u Beogradu otvara prvi Mak

Popularno predavanje iz astronomije u Surdulici

Svet nauke 19.11.2014
Gajic U subotu, 22. novembra, Astronomsko društvo "Vega" iz Surdulice organizuje naučno-popularno predavanje: "Komete (ni)su tako strašne" Predavač ć

U Petnici pušten Belov eksperiment

Svet nauke 11.11.2014
Petnica U Istraživačkoj stanici Petnica nedavno je pušten u rad Belov eksperiment kojim je pre 50 godine potvrđena ispravnost kvantne mehanike. Laborat
  1. March 6th, 2009 at 03:06 | #1

    svaka cast :) a sutra se javi da se dogovorimo oko subote :)

  2. March 6th, 2009 at 09:27 | #2

    Cestitam! :) Svidja mi se

  3. March 6th, 2009 at 18:57 | #3

    hi. Thanks for plugin

    perfect.

    Regards

  4. March 6th, 2009 at 21:14 | #4

    E odlično si ovo napravio. Imam jedan predlog za olakšavanje apliciranja dodatka.

    Napravi add_action trigger, tako da umesto onog

    <code></code>

    korisnik ubacuje samo ovo na mesto gde će da ide ispis:

    <code></code>

  5. March 6th, 2009 at 21:27 | #5

    Hvala za predlog, bice sredjeno.

    Malo je WordPress "pojeo" delove tvog komentara, ali razumeo sam na sta mislis.

  6. avatar
    Kiza
    March 6th, 2009 at 22:24 | #6

    Odlično,super!Eh da ti je Zemlja malo plavša…..

  7. March 11th, 2009 at 23:21 | #7

    nice idea, but if you want it to be realy a "breaking news" plugin, you should add an option to select post no older then e.g. one day. And great is to hide posts which have been readed (user cookie)

  8. March 12th, 2009 at 00:31 | #8

    Thanks for idea, I'll try to add it to next version.

  9. avatar
    iffi
    March 12th, 2009 at 01:25 | #9

    Hi this is exactly what ive been looking for. Ive added the plugin, installed and activated it. Now how would I add a list to the sidebar? Please help, thanks

  10. March 12th, 2009 at 02:25 | #10

    To add plugin in sidebar you have to find sidebar.php in your theme folder and to add same code in the file.

    I'm working on widget for this plugin and it will be finished in few days.

  11. avatar
    GustP
    March 19th, 2009 at 17:59 | #11

    Hi Milan,

    I'm testing your plugin and it works fine. It is a very good plugin.

    But I need to show 3 lists but each list must be on a separate page.

    Is it possible? What should change?

    Thanks in advance.

  12. March 20th, 2009 at 14:31 | #12

    Unfortunately it's not possible with tis version. Maybe, I'll add that possibility in future.

  13. avatar
    Christine Kluka
    April 5th, 2009 at 00:03 | #13

    Hello Milan,

    I downloaded and installed your plugin, checked the instructions on the plugin page, added titles for the 2 lists under MM Breaking News (wordpress options), and made sure that all my permalink categories were selected. I edited my archive.php templates and added a line to check for your plugin, saved changes, but nothing happens.

    What I am trying to do is list my archive posts as bullets that link to posts (so users can choose what they want to read), but even when I select my archives there is no change. I would be happy to show links to blog posts (as a list) on the home page anyway, to make my blog look more professional. What to do?

  14. April 5th, 2009 at 00:17 | #14

    Did you set "Show only on Front page" to "No"?

  15. avatar
    Christine Kluka
    April 5th, 2009 at 02:44 | #15

    As you mentioned, I had forgotten to set "Show only on Front page" to "No"

    All ok now, thanks :)

  16. avatar
    iffi
    April 7th, 2009 at 08:48 | #16

    Hi is there a widget avil for this plug in yet? How do I set it up, thanks.

  17. April 7th, 2009 at 15:32 | #17

    Unfortunately widget is still not available, I didn't have enough time to work on it. This new version was just bug fixing.

    To set up plugin just follow instructions in readme file and place code somewhere in index.php, archive.php and/or page.php file of your theme.

  18. avatar
    fallil
    April 20th, 2009 at 12:25 | #18

    hi milan

    Can i have background-image in bb breakin news area ?

    thanks

  19. April 20th, 2009 at 15:58 | #19

    Sure you can.

    You have to edit mm-bnlist.css file (in plugin folder) and change 14th line:

    background: #eee;

    to something like:

    background: #eee url('image_link');

    Change image_link with link to the image you wish to use as background.

  20. avatar
    Anton Sheker
    May 12th, 2009 at 05:05 | #20

    Great Plugin!

    How do i make it a 2 column breaking news? so i can place different categories per column?

  21. May 13th, 2009 at 13:28 | #21

    It`s not possible, maybe in future.

    I have some other work to do and the priority is to improve the performance of the plugin so I can`t promise when the next version will be available.

  22. avatar
    Ella
    June 4th, 2009 at 17:27 | #22

    Hi…! This rocks. You rock. Thank you for sharing and helping people out. I send you a virtual beer :)

  23. avatar
    Ivona
    January 13th, 2010 at 12:26 | #23

    Odlican plugin, Milane…Sve radi savrseno..

    Zanima me samo jedno.. u opisu stoji “Lists can be show wherever you want – above or below posts, in archive, or on single post or page.”
    Da li to podrazumijeva da se može i ako da, kako prikazati listu unutar stranice koju kreiram?

    Hvala

  24. January 13th, 2010 at 12:32 | #24

    Hvala za komentar :)

    Ne razumem da li želiš da kreiraš jednu stranicu gde se prikazuje lista ili da se prikaže iznad svake stranice? Odgovoriću na oba:

    1. Ako želiš iznad svake stranice onda je potrebno da odgovarajući kod ubaciš u fajl page.php teme koju koristiš

    2. Ako želiš da kreiraš samo jednu stranu sa listom (pretpostavljam da je to) onda je to odlična ideja, koja trenutno nije izvodljiva, ali biće u toku dana ili sutra (sad ću da sredim novu verziju) :)

  25. avatar
    Ivona
    January 13th, 2010 at 12:38 | #25

    Da, htjela bi kreirati jednu stranicu i samo u nju ubaciti listu :-)

    Moj WP je organiziran tako da na početnoj stranici ne prikazuje određen br. postova nego jednu fiksnu stranicu (page), u koju bi htjela ubaciti listu. Probala sam ubaciti u single.php i upaliti opciju “Show only on Front page”, šljaka ali malo rastura izgled (ma neki ludi template koji nije isti u IE i Mozilli, ne pitaj :-)) tako da bi bilo idealnije unutar same stranice ubaciti listu.

    valjda nisam zakomplicirala želje :-)

    hvala…

  26. January 13th, 2010 at 14:57 | #26

    Jasno, probaću da dopunim plugin da to omogući.

  27. January 13th, 2010 at 15:09 | #27

    Ovako si nešto htela http://www.svetnauke.org/mm-breaking-news-test/ ?

    Uradi upgrade na novu verziju (već je na sajtu, obavestiće te WordPress uskoro). Kreiraj stranicu na kojoj se nalazi [mm-breaking-news] i trebalo bi da radi. Za sada nije moguće dodatno formatiranje liste već se koristi standardni izgled koji je definisan temom.

  28. avatar
    Ivona
    January 13th, 2010 at 19:29 | #28

    Daaa…!! to je to.. Super izgleda.. formatiranje nije bitno, ako se poklapa sa temom :-)

    Jedino.. hmm.. čini li mi se (ili je to do moje teme) ali izgleda da lista ima nekakav prioritet, i bez obriza ima li kreirana stranica nekakav tekst prije, listu uvijek stavi na vrh, a tekst ispod..

    nemoj reći da sam prezahtjevna ili da tražim nemoguće.. i ovo do sada je genijalno, zaista..

    puno hvala i svako dobro…

  29. January 13th, 2010 at 19:52 | #29

    Ako radi tako kako si opisala onda negde postoji greška. Proveriću pa ispravljam :)

  30. January 13th, 2010 at 22:48 | #30

    malopre sam isprobavao vas plugin,ono sto sam na brzinu probao , radi ok. sada je problem sto izgleda ima sukoba sa pluginom Google XML Sitemaps,jer kad ga deaktiviram pojavi mi se podesavanja od Google XML Sitemaps plugina,a cim ga ponovo aktiviram vise nisam u mogucnosti da vidim ta podesavanja.danko nis

  31. January 14th, 2010 at 00:39 | #31

    Čudno. Na ovaj plugin misliš? http://wordpress.org/extend/plugins/google-sitemap-generator/

    Kod mene je taj plugin isto aktivan i nema nikakvih problema.

    Ne razumem koja tačno podešavalja nestanu – ona u Settings / XML-Sitemap?

    @Ivona
    Našao sam grešku i ispravio, nova verzija je dostupna za preuzimanje. Hvala :)

  32. avatar
    Ivona
    January 14th, 2010 at 10:43 | #32

    Hvala tebi za tako dobar plugin :-)

  33. avatar
    danko
    January 14th, 2010 at 11:23 | #33

    da to je taj plugin.kad instaliram tvoj vise mi se ne prikazuje Administration interface (strana za podesavanja).to mi se dogadjalo ranije i kod drugih wp sajtova koje sam radio, sa nekim drugim pluginom.
    sto se tice saveta za tvoj plugin,mislim dabi bilo lepo kad bi mogla da se ubaci slika(ikona)pored naslova za izabranu kategoriju.

  34. January 14th, 2010 at 12:24 | #34

    @Ivona
    Nema na čemu, i drugi put :)

    @Danko
    Nisam uspeo da ponovim problem tako da nemam ideju šta je uzrok problema. Ako hoćeš pošalji mi spisak pluginova i verziju WordPress-a koje koristiš da probam da ponovim problem.

    Sviđa mi se ova ideja za sliku kategorije, probaću da to napravim.

  35. avatar
    danko
    January 14th, 2010 at 19:59 | #35

    wp je 2.9,a prvi put mi je problem zadao plugin count-per-day(on sam je super radio ali je onemogucio google-sitemap-generator/)kad sam ga deinstal.sve je bilo ok dok nisam hteo da probam tvoj plugin.
    kako bi bilo da mi se javis na moj mail da te pitam za neke savete
    danko

  36. avatar
    Simon
    January 15th, 2010 at 00:31 | #36

    Hello,

    I have Breaking News on a static page. When I click on the links it keeps going back to the static page and not to the posts they are linked to.

    Thank you – I find this plugin very useful (if I can figure out the link thing :) )

  37. avatar
    Simon
    January 15th, 2010 at 00:33 | #37

    Btw – I have it within a table – not sure if this affects anything
    @Simon

  38. January 15th, 2010 at 00:36 | #38

    Thanks for reporting problem. I made some (stupid) mistake in las version. I’ll solve it in a few minutes and upload new version.

    Thank you.

  39. avatar
    Simon
    January 15th, 2010 at 00:43 | #39

    @Milan Milošević

    Wow! That was fast!
    Thank you so much!
    Very glad you made the plug-in

  40. January 15th, 2010 at 00:57 | #40

    Thank you :) Fixed verion is uploaded and you’ll be able to upgrade in a few minutes. I hope now everything is working :)

  41. avatar
    Simon
    January 15th, 2010 at 01:01 | #41

    @Milan Milošević
    Just tried it and it works beautifully
    WHOOHOO :D
    And thank you once more

  42. avatar
    Stacey Dyer
    January 30th, 2010 at 02:08 | #42

    Nice plug in! I used the shortcode of mm-breaking news for the first list on the page called “News and Releases.” The only problem is that it is displaying the date of when the page was published instead of the dates of the individual blog posts. Can you help, please?

    Thanks!

  43. avatar
    Stacey Dyer
    January 30th, 2010 at 02:41 | #43

    The link is above (linked from my name): http://www.greenhousedata.com/stage/about/latest-news/

  44. January 30th, 2010 at 12:29 | #44

    Thanks, I see the problem. It will be solved in a few hours.

  45. avatar
    Stacey Dyer
    January 31st, 2010 at 20:55 | #45

    @Milan Milošević
    Could you please re-send your e-mail? I think it just got deleted before I read it. I appreciate your help!!!

  46. January 31st, 2010 at 21:59 | #46

    There is new version of plugin. Upgrade and problem should be solved.

  47. avatar
    Stacey Dyer
    February 1st, 2010 at 00:20 | #47

    That is fantastic! Thanks so much for getting to it so quickly! Now, just one more thing…is there a way it can be set to use the date formatting we’ve chosen for our WP site (or select the one we want) – like f j, Y, without the time?

    Thanks again, you are awesome!

  48. February 2nd, 2010 at 12:20 | #48

    At the moment it’s not posible to change date formatting but I’ll try to change code to allow that.

  49. March 15th, 2010 at 03:02 | #49

    Great plugin. I was looking for something like this all day. It is very useful.

    Thank you
    ~ Tom

  50. avatar
    Wienjo
    March 24th, 2010 at 11:57 | #50

    Great plugin, thanks for all the hours of write the code.

    Is its possible to change the witdh of the object? I cant center it (correct me if i’m wrong) and dont see any rules with that option in the CSS.

    thanks!

  51. avatar
    Wienjo
    March 27th, 2010 at 13:12 | #51

    Wienjo :
    Great plugin, thanks for all the hours of write the code.
    Is its possible to change the witdh of the object? I cant center it (correct me if i’m wrong) and dont see any rules with that option in the CSS.
    thanks!

    As you can see (on my website @www.wienjo.nl) the object align is left. I won’t get it in the center so i was thinking of making it 500px so it’s on the same size like my articles..

    Thank you!

  52. March 27th, 2010 at 13:28 | #52

    Sorry I haven’t answer earlier. I accidentally missed your comment :(

    You can try remove margin-right from CSS and add something like margin: 0 auto; (set top & bottom as you like). To add width just and property in CSS

  53. avatar
    Wienjo
    March 27th, 2010 at 14:00 | #53

    Milan Milošević :
    Sorry I haven’t answer earlier. I accidentally missed your comment
    You can try remove margin-right from CSS and add something like margin: 0 auto; (set top & bottom as you like). To add width just and property in CSS

    Thank you! I changed the margin-right and it fit now!

    Thank you!

  54. avatar
    vova
    April 13th, 2010 at 05:40 | #54

    link do not work oi wordpress.org

  55. April 13th, 2010 at 14:35 | #55

    Which link?

  56. avatar
    GBW
    June 10th, 2010 at 21:50 | #56

    Great plugin, it’s exactly what I spent a few hours looking for!! One thing, I’d like to be able to display the “breaking news” outside of wordpress (I have WP installed in it’s own folder), on my site’s main page. I use wordpress for our blog/news but it’s not the site’s mainpage. I want to use the list on the main page to show links to the latest 10 postings…is this possible?

  57. June 10th, 2010 at 22:16 | #57

    It can be done but you have to use some PHP and modify plugin code. If you need some help send me e-mail with more details about your site and I can try to help.

  58. avatar
    Karolina
    June 29th, 2010 at 04:55 | #58

    Hi, I just installed your plugin and I was wondering how can I edit the code so that I change the size of the Headers (names of each category)? I see that the entire font size is listed, but I am not sure what I can add to make just the header larger?

    Thanks much. Great plugin. :-)

  59. avatar
    Karolina
    June 29th, 2010 at 05:13 | #59

    Oh, another question I have. Is there a way that I can have my various categories with posts listed shown in two columns instead of one long column?

    Thank you very much. I appreciate the help.

  60. June 29th, 2010 at 20:42 | #60

    Hi,

    Do you use shortcode, widget or PHP code for template? At the moment it’s not possible to achieve it in an easy way. You can change code and add CSS class and than use a style file. It’s same with 2nd question. :(

    If I’ll have some free time in next few days I’ll add that in next version.

  61. avatar
    Ananda
    July 13th, 2010 at 12:03 | #61

    This is a great plug-in and really adds substantially to any site that has a lot of material on it.

    One thing I would like to see though is a self-generated Table of Contents, as a category may have a lot of posts, and navigating between them then becomes a problem.

    Any chance of being able to add this in future versions?

  62. avatar
    Killy
    July 14th, 2010 at 13:57 | #62

    I am having problems installing this plugin. It say it can not unpack archive. Any clues?

  63. July 15th, 2010 at 21:37 | #63

    @Ananda
    You want to display all posts in a category, and all categories? It looks like good idea, I’ll think about it nex version.

    @Killy
    I’m not sure what can be a problem. You should try to download it form WordPress site and manually copy it to plugin folder.

  64. avatar
    Ananda
    August 27th, 2010 at 03:08 | #64

    Hi Milan,

    At the moment the number of items shown in a category seems to be limited to 10. Is there any way to increase that number?

  65. August 27th, 2010 at 17:09 | #65

    There shouldn’t be a limit if you use shortcode or place it in template. There is limit if you use widget, and you can display only 5 items (I’ll change it soon)

    How do you display categories?

  66. avatar
    femy
    November 25th, 2011 at 14:56 | #66

    Is it possible to have two columns now?Like you promised to put in a new version?If so could you tell me how to?

  67. February 28th, 2012 at 02:46 | #67

    New version is available. Now it supports custom CSS class in widget and you can select how many titles to show.

    Multiple columns can be displayed if you add a code in template file (see Installation instruction)

  1. No trackbacks yet.

Mišljenja iznešena u komentarima su privatno mišljenje autora komentara i ne odražavaju stavove urednika sajta Svet nauke. Komentari koji sadrže psovke, uvredljive, vulgarne, preteće, rasističke ili šovinističke poruke neće biti objavljeni. Prilikom pisanja komentara pridržavajte se pravopisnih pravila. Urednik sajta ima pravo da ne odobri komentare za koje smatra da ne doprinose normalnoj komunikaciji između čitalaca ovog sajta.