Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 213
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 265
Total: 266

Author Topic: [Mod] Tagging System  (Read 151190 times)

0 Members and 1 Guest are viewing this topic.

Offline Nite

  • Member
  • *
  • Posts: 45
    • View Profile
    • Texas Mall
Re: [Mod] Tagging System
« Reply #45 on: July 22, 2007, 04:08:24 pm »
My forum is on a sub-domain. (http://xxx.yyy.com)
My landing page is not on the sub-domain. (http://www.yyy.com)

I would like to pull the data contained inside the tags table and put in on the landing page. This would create more dynamic content on the landing page that would interface with what's happening inside the forum.

How would I do this?

I'm already calling SSI.php from the landing page to display the latest forum posts. I suppose I need to do something different to call out the tag information?






Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: [Mod] Tagging System
« Reply #46 on: July 22, 2007, 06:42:26 pm »
Try something like this untested
Code: [Select]
global $db_prefix, $scripturl, $context;

//Tag cloud from http://www.prism-perfect.net/archive/php-tag-cloud-tutorial/

$query = "SELECT t.tag AS tag, l.ID_TAG, COUNT(l.ID_TAG) AS quantity
  FROM {$db_prefix}tags as t, {$db_prefix}tags_log as l WHERE t.ID_TAG = l.ID_TAG
  GROUP BY l.ID_TAG
  ORDER BY l.ID DESC LIMIT 50";

$result = db_query($query, __FILE__, __LINE__);

// here we loop through the results and put them into a simple array:
// $tag['thing1'] = 12;
// $tag['thing2'] = 25;
// etc. so we can use all the nifty array functions
// to calculate the font-size of each tag
$tags = array();

$tags2 = array();

while ($row = mysql_fetch_array($result))
{
    $tags[$row['tag']] = $row['quantity'];
    $tags2[$row['tag']] = $row['ID_TAG'];
}

if(count($tags2) > 0)
{
// change these font sizes if you will
$max_size = 250; // max font size in %
$min_size = 100; // min font size in %

// get the largest and smallest array values
$max_qty = max(array_values($tags));
$min_qty = min(array_values($tags));

// find the range of values
$spread = $max_qty - $min_qty;
if (0 == $spread)
{ // we don't want to divide by zero
    $spread = 1;
}

// determine the font-size increment
// this is the increase per tag quantity (times used)
$step = ($max_size - $min_size)/($spread);

// loop through our tag array
$context['poptags'] = '';
$row_count = 0;
foreach ($tags as $key => $value)
{
$row_count++;
    // calculate CSS font-size
    // find the $value in excess of $min_qty
    // multiply by the font-size increment ($size)
    // and add the $min_size set above
    $size = $min_size + (($value - $min_qty) * $step);
    // uncomment if you want sizes in whole %:
    // $size = ceil($size);

    // you'll need to put the link destination in place of the #
    // (assuming your tag links to some sort of details page)
    $context['poptags'] .= '<a href="' . $scripturl . '?action=tags;id=' . $tags2[$key] . '" style="font-size: '.$size.'%"';
    // perhaps adjust this title attribute for the things that are tagged
   $context['poptags'] .= ' title="'.$value.' things tagged with '.$key.'"';
   $context['poptags'] .= '>'.$key.'</a> ';
   if ($row_count > 5)
   {
    $context['poptags'] .= '<br />';
    $row_count =0;
   }
    // notice the space at the end of the link
}
}




echo $context['poptags'];


Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/


Offline PiSiK0PATR

  • Member
  • *
  • Posts: 1
    • View Profile
Re: [Mod] Tagging System
« Reply #48 on: July 31, 2007, 05:30:21 am »
I want to that.You must make tags mode's seo...

http://www.sitename.com/tags.html;id=1007 or
http://www.sitename.com/tags/Graphic

I want to that.You must make tags mode's tag cluod

Excuse Me I Cant You Speak Engilish :S

Offline hardnemesis

  • Member
  • *
  • Posts: 1
    • View Profile
Re: [Mod] Tagging System
« Reply #49 on: August 13, 2007, 03:03:46 pm »
Hey i am new this mod good but i have a problem pls help me :(
My problem is that i use theme çölateşi  v3 turkish theme
i load this mod but only load it work in default theme, what do i do for working in colatesi v3 theme
ss is here

Shot at 2007-08-13


Shot at 2007-08-13

Waiting your answers Thanks...

Offline mogu

  • Member
  • *
  • Posts: 2
    • View Profile
    • YUKO-FORUM.de
Re: [Mod] Tagging System
« Reply #50 on: September 23, 2007, 05:01:24 pm »
I really like your mod, just a note:
the title attribute of the tags' links is hardcoded in English (Tags.php, line 156)

@hardnemesis:
the Tags.xml file in the package exactly tells you where to insert what.
it's possible to do that manually, and actually I always do it myself :).
besides, don't forget to copy Tags.english.php and modify and rename it for Turkish.
http://YUKO-FORUM.de/ - das Japanisch-Forum

Offline JW01

  • Member
  • *
  • Posts: 1
    • View Profile
Re: [Mod] Tagging System
« Reply #51 on: November 06, 2007, 10:19:39 am »
Hi,

Great Mod, but I do have a question about adding it to custom themes that do not have the Post.template.php file in the theme dir.. how do we get it to work.. for instance in Alienation or XD-Zeda?

Thanks

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: [Mod] Tagging System
« Reply #52 on: November 06, 2007, 08:26:44 pm »
If they do not have the file it just needs to be added to the defaul theme.

The current theme will pickup what ever template files are missing by using the default theme files.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline joecool85

  • Member
  • *
  • Posts: 6
    • View Profile
Re: [Mod] Tagging System
« Reply #53 on: December 04, 2007, 11:57:39 am »
I love this mod, but right now there are two issues I've noticed.

First:
If you have two things tagged the same it lists the tag twice.  For instance, church and church.  I would like it so that If the tag was already there it wouldn't list it again.  That way if you click on the tag, instead of just showing the one thread associated with it, it would show all threads associated with "church."

Second:
It seems you can only add tags to the first post of the thread, it would be nice if you could add them to posts later in a thread.

**edit**
It seems the issue with tags not connecting to each has to do with the order they are tagged.  For instance if I tag one thing "church, somethingelse, dogs" and the next thread "church, house, people" then "church" lists both threads.  However, if I tag the second thread with church as the second tag it doesn't work, IE "house, church, people."
« Last Edit: December 04, 2007, 12:06:32 pm by joecool85 »

Offline catchpen

  • Member
  • *
  • Posts: 10
    • View Profile
Re: [Mod] Tagging System
« Reply #54 on: December 23, 2007, 11:17:00 am »
I love this mod, but right now there are two issues I've noticed.

First:
If you have two things tagged the same it lists the tag twice.  For instance, church and church.  I would like it so that If the tag was already there it wouldn't list it again.  That way if you click on the tag, instead of just showing the one thread associated with it, it would show all threads associated with "church."

Second:
It seems you can only add tags to the first post of the thread, it would be nice if you could add them to posts later in a thread.

**edit**
It seems the issue with tags not connecting to each has to do with the order they are tagged.  For instance if I tag one thing "church, somethingelse, dogs" and the next thread "church, house, people" then "church" lists both threads.  However, if I tag the second thread with church as the second tag it doesn't work, IE "house, church, people."
The only workaround is to go back and apply one tag at a time. But try explaining this to members posting  :-[

Offline IWAC

  • Member
  • *
  • Posts: 4
    • View Profile
Re: [Mod] Tagging System
« Reply #55 on: December 26, 2007, 12:19:41 pm »
Hi I really wanted to use this mod, but i couldn't download it due to this errormessage...

Quote

Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.


And it is this file which has failed the 'test'

7.     Execute Modification     ./Sources/Post.php     Test failed

Any ideas what i should do?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: [Mod] Tagging System
« Reply #56 on: December 26, 2007, 07:45:27 pm »
Try to install it manually using the Package Parser
http://www.smfhacks.com/smf-package-parser.html
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline IWAC

  • Member
  • *
  • Posts: 4
    • View Profile
Re: [Mod] Tagging System
« Reply #57 on: December 27, 2007, 03:15:38 am »
Cheers Dan.

 That worked and helped a lot as there was more than one page I needed to edit.

Thats a great piece of software you got there and I just noticed the theme generator too.

Looks like I need to bookmark those 2 pages.  ;D

Offline joecool85

  • Member
  • *
  • Posts: 6
    • View Profile
Re: [Mod] Tagging System
« Reply #58 on: December 28, 2007, 07:23:22 am »
I love this mod, but right now there are two issues I've noticed.

First:
If you have two things tagged the same it lists the tag twice.  For instance, church and church.  I would like it so that If the tag was already there it wouldn't list it again.  That way if you click on the tag, instead of just showing the one thread associated with it, it would show all threads associated with "church."

Second:
It seems you can only add tags to the first post of the thread, it would be nice if you could add them to posts later in a thread.

**edit**
It seems the issue with tags not connecting to each has to do with the order they are tagged.  For instance if I tag one thing "church, somethingelse, dogs" and the next thread "church, house, people" then "church" lists both threads.  However, if I tag the second thread with church as the second tag it doesn't work, IE "house, church, people."
The only workaround is to go back and apply one tag at a time. But try explaining this to members posting  :-[

For right now I guess I will need to mod the file so it tells the user to only input one tag at a time.

Offline catchpen

  • Member
  • *
  • Posts: 10
    • View Profile
Re: [Mod] Tagging System
« Reply #59 on: January 22, 2008, 05:17:31 pm »
The most popular tag I have is "free" and it's not showing in the cloud but the posts tagged free show in recent tagged topics list.

how I can bump the "free" tag to the cloud? It's long lost ???

I also have a "free shipping" tag. Is this screwing it up?

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
3671 Views
Last post July 06, 2007, 09:06:45 pm
by GenoDemoN
5 Replies
6873 Views
Last post November 09, 2007, 06:39:44 pm
by cru
1 Replies
4033 Views
Last post February 04, 2013, 02:06:54 pm
by SMFHacks
7 Replies
9093 Views
Last post December 11, 2013, 01:20:36 am
by Zavoolon
2 Replies
5645 Views
Last post October 21, 2013, 12:05:37 pm
by insider

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal