aRo` automating your e-commerce

This blog has been neglected due to the success of Solidshops.com
17Feb/08

moserious SEO rap movie 101

Moserious made this creative rap movie covering the basics of SEO/paid search.

Well done !

Popularity: 4% [?]

Filed under: SEO No Comments
17Feb/08

capture the encoding from the main XML file tag

To capture the encoding from the XML tag of the file. We need to read the first line, and pass it to the function to capture the encoding value.

The first line looks like this:

< ?xml version="1.0" encoding="utf-8"? >

The PHP code:

PHP:
  1. function readfirstline($file){
  2.    $fp = @fopen($file, "r");
  3.    $firstline = fgets($fp);
  4.    fclose($fp);
  5.    return $firstline;
  6. } 
  7. function get_attr(  $line ,$attr) {
  8.   $start = strpos($line,"$attr");
  9.   $linesubstr($line,$start);
  10.   $arr_enc = split("\"",$line);
  11.  
  12.   return $arr_enc [1];
  13. }
  14.  
  15. $path = "home/user/feeds/id.xml";
  16. $line= readfirstline($path);
  17.        
  18. echo get_attr(  $line ,"encoding");

Popularity: 4% [?]

Filed under: php, xml No Comments
1Feb/08

hot or not wordpress plugin

This wordpress plugins adds a radio button to the comment form so users can tell if a post is hot or not. Depending on the value that is chosen, another css class is added to comment .

  1. Download the plugin
  2. Download the Hot Or Not plugin here
    Unzip this file into the /wp- content/plugins/ folder.

  3. Adding the radionbutton group to the comment form.
  4. This radiobutton has to be added in the < form > tag of the comments. You can find this somewere at the bottom of your "template/comments.php" file. It looks something like this.

    HTML:
    1. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

    You have to paste the code below in that form.

    HTML:
    1.   <input name="hon_group" type="radio" /> Yes
    2.   <input name="hon_group" CHECKED="true" type="radio" /> no
    3.  </p>

  5. Dynamically add the class to the comment
  6. In the beginning of that same file, there is a php foreach statement to print all comments.

    HTML:
    1. <?php foreach ($comments as $comment) ?>

    A bit further in the file you have to add the hotornot class to the listitem:

    HTML:
    1. li id="comment-<?php comment_ID() ?>" class="<?php print $comment->css ?>">

  7. Activate the plugin
  8. Active the plugin in the admin "Plugins" screen in wordpress.

  9. Change the css style of your comments
  10. You can do this in the template/style.css file.

    .vote_hot {style.css (line 692)
    background-color:#CDEEAB;
    border-top:1px dotted #006600;
    color:#006600;
    }

    .vote_not {style.css (line 699)
    background-color:#FFE0E0;
    border-top:1px dotted #F5857E;
    color:#AB0000;
    }

Popularity: 28% [?]

Filed under: php, software 7 Comments