dorutz.ro

I would like to change the world, but they won't give me the source code…

No public Twitter messages.

Facebook
RSS

Am scris un plugin pentru WordPress ce ofera posibilitatea de a adauga campuri suplimentare la comentarii. EN: I wrote an WordPress Plugin that offers the possibility of adding custom fields to WP comments.Cautand o posibilitate de a atasa campuri suplimentare la comentariile WordPress (gen nr. telefon, locatie), nu am gasit pe net nimic de ajutor (fara bani! – nu vreau sa dau 30$ pentru asta). Si cum ce e facut cu mana ta, e sfant, m-am apucat sa scriu un plugin pentru WordPress ce face exact acest lucru: ofera posibilitatea de a adauga campuri suplimentare la comentarii. M-am folosit de campul META al comentariilor, adaugand informatiile dorite. Aceste informatii sunt afisate in WP-ADMIN si editabile.

 

Download plugin (click pe icon).Wordpress Plugin - Additional comment fields

Dupa instalare (upload si activare) mai trebuie doar sa adaugati in comments.php in interiorul formularului urmatoarea bucata de cod:

 

<?php if(function_exists(‘dtzACF_comment_phone’)) { ?>
<label for=”additional-comment-fields-phone”>Telefon <small><?php if ($req) echo “(obligatoriu)”; ?></small></label>
<input type=”text” name=”additional-comment-fields-phone” id=”additional-comment-fields-phone” size=”22″ tabindex=”3″ <?php if ($req) echo “aria-required=’true’”; ?> />
<?php } ?>

<?php if(function_exists(‘dtzACF_comment_location’)) { ?>
<label for=”additional-comment-fields-location”>Localitate / Judet <small><?php if ($req) echo “(obligatoriu)”; ?></small></label>
<input type=”text” name=”additional-comment-fields-location” id=”additional-comment-fields-location” size=”22″ tabindex=”4″ <?php if ($req) echo “aria-required=’true’”; ?> />
<?php } ?>

Aceasta bucata de cod adauga in formularul de comentarii campurile suplimentare dorite (in cazul meu – nr. telefon si locatie). Bineinteles, puteti modifica fara restrictii codul, adaugand alte campuri sau stergand ceea ce nu este necesar. Succes!

English:

I used the META field of the comment (works only with WP 2.7 and up), adding the info as META-Tags. It is pretty self explanatory for anyone with little programming skills. You can add your custom extra info fields and view & edit only in Admin.  Feel free to edit / modify the code. Read the file included with the plugin archive. Good luck!

 

Download plugin (click on the icon).Wordpress Plugin - Additional comment fields

After installing plugin (upload & activate) remember to add the custom info fields to comments.php file. Example code:

 

<?php if(function_exists(‘dtzACF_comment_phone’)) { ?>
<label for=”additional-comment-fields-phone”>Phone <small><?php if ($req) echo “(required)”; ?></small></label>
<input type=”text” name=”additional-comment-fields-phone” id=”additional-comment-fields-phone” size=”22″ tabindex=”3″ <?php if ($req) echo “aria-required=’true’”; ?> />
<?php } ?>

<?php if(function_exists(‘dtzACF_comment_location’)) { ?>
<label for=”additional-comment-fields-location”>Location <small><?php if ($req) echo “(required)”; ?></small></label>
<input type=”text” name=”additional-comment-fields-location” id=”additional-comment-fields-location” size=”22″ tabindex=”4″ <?php if ($req) echo “aria-required=’true’”; ?> />
<?php } ?>


4 Chords - so many songs....

Un videoclip amuzant care investigheaza "stiinta" din spatele melodiilor foarte cunoscute. Doar 4 acorduri (rearanjate, tempo diferit) stau la baza ...

BAC 2011 - Vai de curu' n...

Dupa rezultatele dezastruoase de la BAC 2011, cunoscuta secventa cu Hitler subtitrat nu a intarziat sa apara. Dupa mine, este ...

Ce poti face cu mustele?...

Ce faci cand te plictisesti la serviciu? omori cateva muste; le pui la soare sa se usuce, cam o ora; dupa ce s-au ...

Funny Weekend...

  Citat dintr-o scrisorica primita de la finante: Suntem nevoiti sa va returnam declaratia fiscala cu rugamintea sa o revedeti si ...

Asta-i muzica ce-mi place...

Youtube embed la 2 piese autohtone de vara, relaxante, usor de consumat cu BR-RC (bere receeee)... Clipurile sunt geniale. Text/Voce/Muzica: Mark ...