WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Titles to Tags] Fixed it! The Hack that Helped Me

[Plugin: Titles to Tags] Fixed it! The Hack that Helped Me

  • iftomkins
    Member

    @iftomkins

    The most recent version of the plugin didn’t work for me, so here’s the hacky solution I used to get it working:

    1. I started with the previous version of the plugin: 3.0.1, which I downloaded from the plugin page. This version worked for me, but the stopwords didn’t.

    2. Then, I modified hn_title_to_tags.php. On lines 127 to 142, this was the old code:

    private function getStopWords() {
    		// Do we have stopwords in the db?
    		if($stopwords = get_option('hn_title_to_tags')) :
    			return $stopwords;
    		// If not, use the default list:
    		else :
    			$file 			= dirname(__FILE__).'/stopwords.txt';
    			$stopwords		= file_get_contents($file);
    			$verboten		= explode(',', $stopwords);
    			for($x = 0; $x < count($verboten); $x++) :
    				$verboten[$x]	= $this->lowerNoPunc($verboten[$x]);
    			endfor;
    			update_option('hn_title_to_tags', $verboten);
    			return $verboten;
    		endif;
    	}

    And I replaced it with this code:

    private function getStopWords() {
    		// Do we have stopwords in the db?
    			$file 			= dirname(__FILE__).'/stopwords.txt';
    			$stopwords		= file_get_contents($file);
    			$verboten		= explode(',', $stopwords);
    			for($x = 0; $x < count($verboten); $x++) :
    				$verboten[$x]	= $this->lowerNoPunc($verboten[$x]);
    			endfor;
    			update_option('hn_title_to_tags', $verboten);
    			return $verboten;
    	}

    That just took out the ability to add Stop Words from the settings area, since that wasn’t working.

    3. I created a file called stopwords.text, and placed it in the title-to-tags plugin folder.

    4. I pasted all the default stopwords from the options panel into it. If I need to add new stopwords, I’ll have to do it through this text file, but at least it’s working!

    Hacky, but I love it.

    http://wordpress.org/extend/plugins/title-to-tags/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Titles to Tags] Fixed it! The Hack that Helped Me’ is closed to new replies.