Upgrading from tags mod version 1 to version 2

If you have installed my tags mod, version 1 and want to upgrade to version 2, you will need to roll back a couple changes we made, this is relatively painless, but you need to switch back to using POST before we can upgrade to version two.

So let's get rolling, as always BACK-UP your snews.php file first, then find the function searchform.

// change the "method" from "get" back to "post"
form id="search_engine" method="post"

OK, now find the function search, and replace GET with POST.

// change the "method" from "get" back to "postt"
$search_query = clean(cleanXSS($_POST['search_query']));

and then in the function center

// change the "method" from "get" back to "post"
switch(true) {
            case isset($_POST['search_query']):
                search(); return; break;
            case isset($_POST['comment']):
                comment('comment_posted'); return; break;

now change the search_query to the "tag/", find the two instances of

echo $pre.'<a href="'._SITE.'?search_query='. urlencode($article_tags[$i]).'" title="See more articles on '.$article_tags[$i].'">'.$article_tags[$i].'</a>';

and change the "?search_query=" part highlighted

echo $pre.'<a href="'._SITE.'tag/'. urlencode($article_tags[$i]).'" title="See more articles on '.$article_tags[$i].'">'.$article_tags[$i].'</a>';

If you changed the search_query char limit, you may want to change that back.

// change the 3 to a 4
if (strlen($search_query) < 4 || $search_query == l('search_keywords')) {

That's it, leave the other changes in place, and just skip steps 4, 5, & 6 when upgrading to version 2.

Share or Bookmark This Post:


Comments

RSS Comments Feed


No comments yet.




(optional, not publicly displayed)


(optional)

Subscribe

RSS Feed

Archives

Powered by HTML5

HTML5 Powered with CSS3 / Styling, Multimedia, and Semantics