Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter tici

    (@tici)

    Hi Stajich and sorry for being so late with this reply. Well, my problem was because of a plugin named Comment Karma. I have rewrite it to support the $wpdb class and now it’s everything ok.

    Thread Starter tici

    (@tici)

    Well, actually a plugin was causing me problems with the above. I’ve forgot to overwrite a custom query (used for testing pourposes).

    Phew, I’m saved now.

    Thread Starter tici

    (@tici)

    Hello Otto! Thanks for your reply.

    Err, I did all the things out there to make it to work normally. I’ve checked all my plugins (most of the cases they are built by me). I’m not using any of the ones from wordpress directory. They are very well tested on other hosting providers (they all using the $wpdb class – so I dont have any custom queries – my plugins are very well coded).

    I don’t have access to any MySQL conf file as I`m on a shared hosting. Also, this hosting provider doesn’t help me with anything. They only provided me with the above. So I can’t spot the problem only with that information.

    I think they could easily tell the file that causing the problem directly. They want money for extra-support. I don’t believe this is happening to me.

    I read all the opened threads out there but I couldn’t find anything to satisfy my needs.

    Man …I’ll go crazy in one day, I`m stamped here.

    Thanks again Otto for your nice words,
    Have a nice day.

    P.S – sorry for my english

    – Tici

    <?php
    /**
    * Strips html from tags
    *
    * @param array $array_of_tags
    * @param bool (true or false) true = prints out the tags / false = saves them into one variable for later usage
    * @return string
    */
    if(!function_exists('strip_html_from_tags'))
    {
          function strip_html_from_tags($tags, $echo = true)
          {
                $originalArray = $tags; // keep original array intact for now
                $lastTag = array_pop($tags); // we only need the name from this
    
                $separator = ", "; // Replace comma with another character as your new separator
                $output    = "";
    
                foreach($originalArray as $tag) // loop throught the $originalArray to capture each tag name and save them in the $output variable
                {
                      $output .= $tag->name;
                      // determine the use of the separator
                      $output .= ($tag->name == $lastTag->name) ? '' : $separator; // if we're on the $lastTag, delete de $separator
                }
                unset($lastTag); // no need this anymore
    
                // Display type
                if($echo)
                {
                      echo $output; // prints them on screen
                }
                else
                {
                      return $output; // saves them for later parsing (maybe to link them back?)
                }
          }
    }
    
    /*--------------------------------------------
    | Usage example - you have to be in the loop |
    ---------------------------------------------*/
    
    // Ex 1: print your tags
    $tags = get_the_tags();
    strip_html_from_tags($tags); // this will echo out the tags
    
    echo "";
    
    // Ex 2 (using the 2nd parameter)
    $tags = get_the_tags();
    $tags = strip_html_from_tags($tags, false); // you may save them for later usage
    
    // An example of the above usage (passing the 2nd parameter) would be:
    $myStrippedTags = explode(', ', $tags);
    // now $myStrippedTag is an array of tags - do something to each of them
    foreach($myStrippedTags as $tag)
    {
         // Maybe you would like to link them back?
         // ...but I found this unnecesary to link them back - because you will reinvent the "the_tags" function
         echo "<a href='".get_bloginfo('url')."/tag/{$tag}' title='{$tag}'>{$tag}</a>";
    }
    ?>

    Well – I did the best I can to help you, as my english isn’t the best.
    Hope you will find this useful.

    Bye now.
    Tici

    I will provide you in a few minutes with a very simple function. Just wait, don’t go.

Viewing 5 replies - 1 through 5 (of 5 total)