NP_TechnoratiTags (v0.9.x, now a functional tagging system)

Post your new plugins here!
vinhboy
Nucleus Guru
Nucleus Guru
Posts: 382
Joined: Sat Oct 14, 2006 11:19 pm

Postby vinhboy » Fri Apr 20, 2007 9:40 pm

I think I figured out admun

$this->init_AC();


is calling init_AC function BEFORE the tables are created.
so init_AC don't see tables and spit out errors.

I am not sure how the JS relates to the init_AC, so I can't make any changes right now.
All I know is, when I remove

$this->init_AC();


the autocomplete don't work. Please advise how to fix. Thanks!
User avatar
admun
Nucleus Guru
Nucleus Guru
Posts: 4088
Joined: Mon Oct 20, 2003 2:57 am
Location: San Francisco, CA, USA
Contact:

Postby admun » Fri Apr 20, 2007 10:44 pm

vinhboy wrote:I think I figured out admun

$this->init_AC();


is calling init_AC function BEFORE the tables are created.
so init_AC don't see tables and spit out errors.

I am not sure how the JS relates to the init_AC, so I can't make any changes right now.
All I know is, when I remove

$this->init_AC();


the autocomplete don't work. Please advise how to fix. Thanks!

The init_AC() is feeding an array of known tags to js. That's why the autocomplete won't work after you remove it....

The thing is that it's using a table that should already existed..... which is created when the plugin is installed... so I have no idea why you don't have the table???
digilee
Posts: 543
Joined: Thu Jan 19, 2006 11:37 am

Postby digilee » Tue Apr 24, 2007 11:50 pm

here's a weird one ... in my tag cloud the tags are displayed fine but also I have + as a tag.
Some of the tags have + in them but they are like web+designer, for example.

Any ideas on how to stop the + being used as a tag?

I'm using 0.8.4. I tried a newer version but it simply wouldn't work, (similar problems to my other site - mentioned earlier.
I have "Display "+" as " " (space)?" - 'yes' checked.

In the tags at the bottom of the post the space is shown.
User avatar
admun
Nucleus Guru
Nucleus Guru
Posts: 4088
Joined: Mon Oct 20, 2003 2:57 am
Location: San Francisco, CA, USA
Contact:

Postby admun » Wed Apr 25, 2007 2:23 am

digilee wrote:here's a weird one ... in my tag cloud the tags are displayed fine but also I have + as a tag.
Some of the tags have + in them but they are like web+designer, for example.

Any ideas on how to stop the + being used as a tag?

I'm using 0.8.4. I tried a newer version but it simply wouldn't work, (similar problems to my other site - mentioned earlier.
I have "Display "+" as " " (space)?" - 'yes' checked.

In the tags at the bottom of the post the space is shown.

try search for all

Code: Select all

str_replace('+',' ',$t);


in the code and remove them......

I have no idea where is the problem.... :cry:
digilee
Posts: 543
Joined: Thu Jan 19, 2006 11:37 am

Postby digilee » Wed May 02, 2007 9:11 pm

me again ... I bet you hate me now!!

Just a quick question ... is it possible to display the results, in the results skin, by date with the latest first?

I'll leave it at that for now!
User avatar
admun
Nucleus Guru
Nucleus Guru
Posts: 4088
Joined: Mon Oct 20, 2003 2:57 am
Location: San Francisco, CA, USA
Contact:

Postby admun » Wed May 02, 2007 11:53 pm

digilee wrote:me again ... I bet you hate me now!!

Just a quick question ... is it possible to display the results, in the results skin, by date with the latest first?

I'll leave it at that for now!

No, I don't hate you. :wink:

You can change the SQL query in doSkinVar(), look for something llike

Code: Select all

$query = "select t.itemid, i.ititle from " . $this->tablename . " as t, ". sql_table('item')
                                 . " as i where tags like "%" . $tag . "%" and t.itemid = i.inumber ";
                        if ($blogid == "current") {
                                $query .= " and i.iblog = " . $blog->getID();
                        }
                        else if (is_numeric($blogid)) {
                                $query .= " and i.iblog = " . $blogid;
                        }
                        // else for "all", which has not i.iblog=xyz

                        $query .= " order by i.inumber";


You need to change the query to something like

Code: Select all

$query = "select t.itemid, i.ititle, i.itime from " . $this->tablename . " as t, ". sql_table('item')
                                 . " as i where tags like "%" . $tag . "%" and t.itemid = i.inumber ";
                        if ($blogid == "current") {
                                $query .= " and i.iblog = " . $blog->getID();
                        }
                        else if (is_numeric($blogid)) {
                                $query .= " and i.iblog = " . $blogid;
                        }
                        // else for "all", which has not i.iblog=xyz

                        $query .= " order by i.itime desc";



note, I didn't try this code......
digilee
Posts: 543
Joined: Thu Jan 19, 2006 11:37 am

Postby digilee » Thu May 03, 2007 11:35 am

I have

Code: Select all

function doSkinVar($skinType, $type = 'cloud', $sort = 'alp', $maxtags = -1)
   {
                global $blog, $manager;

                if ($type == 'tagsearch') {
                        $tag = urlencode(RequestVar('tag'));
                        // need to strip ; and do sanity test for security....

                        echo "<div>All locations tagged <b><i>" . $tag . "</i></b></div><br />";
                        $query = "select itemid from " . $this->tablename . " where tags like \"%" . $tag . "%\""; // **** need better than %% *****
                        $res = mysql_query($query);
                        echo "<ul>";
                        while ($row = mysql_fetch_object($res)){
                                $item =& $manager->getItem($row->itemid, 0, 0);
                                $link = createItemLink($row->itemid);
                                echo "<a href=\"" . $link . "\">" . $item['title'] . "</a><br />";
                        }
                        echo "</ul>";

                }
      else if ($type == 'cloud' || $type == 'localcloud') {


do you mean in the mysql file itself?

If so, would I be able to make this change with phpmyadmin?
User avatar
admun
Nucleus Guru
Nucleus Guru
Posts: 4088
Joined: Mon Oct 20, 2003 2:57 am
Location: San Francisco, CA, USA
Contact:

Postby admun » Thu May 03, 2007 1:28 pm

digilee wrote:I have

Code: Select all

function doSkinVar($skinType, $type = 'cloud', $sort = 'alp', $maxtags = -1)
   {
                global $blog, $manager;

                if ($type == 'tagsearch') {
                        $tag = urlencode(RequestVar('tag'));
                        // need to strip ; and do sanity test for security....

                        echo "<div>All locations tagged <b><i>" . $tag . "</i></b></div><br />";
                        $query = "select itemid from " . $this->tablename . " where tags like "%" . $tag . "%""; // **** need better than %% *****
                        $res = mysql_query($query);
                        echo "<ul>";
                        while ($row = mysql_fetch_object($res)){
                                $item =& $manager->getItem($row->itemid, 0, 0);
                                $link = createItemLink($row->itemid);
                                echo "<a href="" . $link . "">" . $item['title'] . "</a><br />";
                        }
                        echo "</ul>";

                }
      else if ($type == 'cloud' || $type == 'localcloud') {


do you mean in the mysql file itself?

If so, would I be able to make this change with phpmyadmin?

No, you just need a change to the SQL query you show here.

hum, the old version you used didn't have that.... I guess you can try to merg this change into your version. You are looking at the right spot.
digilee
Posts: 543
Joined: Thu Jan 19, 2006 11:37 am

Postby digilee » Fri May 04, 2007 1:25 am

hhmmm ... I'll try but php isn't my strong point.
Shi
Posts: 83
Joined: Thu Jan 18, 2007 3:05 am
Contact:

Postby Shi » Fri May 04, 2007 5:46 pm

I think you should change this:
$query = "select itemid from " . $this->tablename . " where tags like \"%" . $tag . "%\"";

to:
$query = "select itemid, itime from " . $this->tablename . " where tags like \"%" . $tag . "%\" order by itime desc";


I don't try this code too, but this should work I think.
digilee
Posts: 543
Joined: Thu Jan 19, 2006 11:37 am

Postby digilee » Sat May 05, 2007 1:06 am

No luck.

Error:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/pathto/plugins/NP_TechnoratiTags.php on line 427

Line 427 is:
while ($row = mysql_fetch_object($res)){
Shi
Posts: 83
Joined: Thu Jan 18, 2007 3:05 am
Contact:

Postby Shi » Sat May 05, 2007 8:12 am

Aa, I didn't realize that your version only make the query to the tags table and not the item table.

Try changing that to this:
$query = "select t.itemid, i.ititle, i.itime from " . $this->tablename . " as t, ". sql_table('item') . " as i where tags like \"%" . $tag . "%\" and t.itemid = i.inumber order by i.itime desc";


Sorry I can't try the code because I don't know the version you are using.
digilee
Posts: 543
Joined: Thu Jan 19, 2006 11:37 am

Postby digilee » Sat May 05, 2007 1:21 pm

That worked, thanks.

The version I am using is - 0.8.4
This is the only one that I can get working fine, (possibly a conflict with other plugs).

The last thing I need to do, now, is add the post date to the beginning of each result.
Shi
Posts: 83
Joined: Thu Jan 18, 2007 3:05 am
Contact:

Postby Shi » Sat May 05, 2007 3:04 pm

Change this line:

Code: Select all

echo "<a href=\"" . $link . "\">" . $item['title'] . "</a><br />";

to:

Code: Select all

echo $item['itime'] . ": <a href=\"" . $link . "\">" . $item['title'] . "</a><br />";


Sorry have not tried this too, I don't have version 0.8.4 of NP_TechnoratiTags.
Shi
Posts: 83
Joined: Thu Jan 18, 2007 3:05 am
Contact:

Postby Shi » Sat May 05, 2007 7:07 pm

admun,

I understand that the 3.3 version of English Nucleus is not released yet, but I have upgraded to 3.3 and changed the .htaccess file to the fancyurl-2 one, and it caused TechnoratiTags with FancyURL not working anymore.

I think it can be fixed with editing the tags.php and put the URI explode there instead. I haven't tried that though, I am still upgrading the other plugins :oops:.

Thank you :).
digilee
Posts: 543
Joined: Thu Jan 19, 2006 11:37 am

Postby digilee » Sat May 05, 2007 7:42 pm

I actually tried idate, thinking it would then display day/month but that didn't work.
itime is good but it displays at 2007 05 03 11:27:00, for example.

Normally I could change this in the template, but as it's the tags skin it doesn't have this option.

More research for me I think.
digilee
Posts: 543
Joined: Thu Jan 19, 2006 11:37 am

Postby digilee » Sat May 05, 2007 7:57 pm

Shi wrote:admun,

I understand that the 3.3 version of English Nucleus is not released yet, but I have upgraded to 3.3 and changed the .htaccess file to the fancyurl-2 one, and it caused TechnoratiTags with FancyURL not working anymore.

I think it can be fixed with editing the tags.php and put the URI explode there instead. I haven't tried that though, I am still upgrading the other plugins :oops:.

Thank you :).


This could also be linked to why I can't get the 2 plugs to play nicely with each other.
I'm not on 3.3, obviously, but there could be some connection.
Shi
Posts: 83
Joined: Thu Jan 18, 2007 3:05 am
Contact:

Postby Shi » Sat May 05, 2007 8:29 pm

digilee wrote:I actually tried idate, thinking it would then display day/month but that didn't work.
itime is good but it displays at 2007 05 03 11:27:00, for example.

Normally I could change this in the template, but as it's the tags skin it doesn't have this option.

More research for me I think.

Maybe you can give me your version of NP_TechnoratiTags and it'll be easier for me to help you.
digilee
Posts: 543
Joined: Thu Jan 19, 2006 11:37 am

Postby digilee » Sat May 05, 2007 8:34 pm

It can be downloaded from:
http://z6.co.uk/techtags.zip

This is a zipped version of what I am using. i have made some small changes, but only cosmetic.

Thanks.
Shi
Posts: 83
Joined: Thu Jan 18, 2007 3:05 am
Contact:

Postby Shi » Sat May 05, 2007 9:11 pm

Download it here: http://renpishi.up.seesaa.net/image/NP_ ... 8.4mod.zip

You have to uninstall then reinstall the plugin.
The time formatting will be edited through an option of the plugin. It is almost the same as formatting with Nucleus Template.
See the most bottom of the option:
Image

I have tested it and it works. I hope this works for you.

---

admun,

About what I said - the FancyURL might still work if the htaccess is combined with the old ForceType one for TechnoratiTags I think :oops:.

Return to “Plugin Development”