SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
September 06, 2010, 09:37:29 pm

Login with username, password and session length
Members
Total Members: 8386
Latest: jmanceli2010
Stats
Total Posts: 21963
Total Topics: 4072
Online Today: 38
Online Ever: 399
(March 21, 2008, 10:16:14 pm)
Users Online
Users: 4
Guests: 34
Total: 38
Sponsored Links
+  SMFHacks.com
|-+  Forum
| |-+  Modifications/Themes
| | |-+  Modifications Talk
| | | |-+  Latest Mods
| | | | |-+  [Mod] Tagging System
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: 1 2 3 [4] 5 6 7 Go Down Print
Author Topic: [Mod] Tagging System  (Read 55736 times)
Nite
Newbie
*
Offline Offline

Posts: 45



View Profile WWW Email
« 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?





Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 7331


View Profile
« Reply #46 on: July 22, 2007, 06:42:26 pm »

Try something like this untested
Code:
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'];


Logged
Nite
Newbie
*
Offline Offline

Posts: 45



View Profile WWW Email
« Reply #47 on: July 22, 2007, 07:02:15 pm »

Awesome!

Demo :: Permian Basin Internet Community.
Logged

PiSiK0PATR
Newbie
*
Offline Offline

Posts: 1


View Profile Email
« 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
Logged
hardnemesis
Newbie
*
Offline Offline

Posts: 1


View Profile Email
« 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 Sad
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...
Logged
mogu
Newbie
*
Offline Offline

Posts: 2


View Profile WWW
« 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 Smiley.
besides, don't forget to copy Tags.english.php and modify and rename it for Turkish.
Logged

http://YUKO-FORUM.de/ - das Japanisch-Forum
JW01
Newbie
*
Offline Offline

Posts: 1


View Profile Email
« 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
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 7331


View Profile
« 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.
Logged
joecool85
Newbie
*
Offline Offline

Posts: 6


View Profile Email
« 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 » Logged
catchpen
Newbie
*
Offline Offline

Posts: 10


View Profile
« 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  Embarrassed
Logged
IWAC
Newbie
*
Offline Offline

Posts: 4


View Profile
« 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?
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 7331


View Profile
« 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
Logged
IWAC
Newbie
*
Offline Offline

Posts: 4


View Profile
« 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.  Grin
Logged
joecool85
Newbie
*
Offline Offline

Posts: 6


View Profile Email
« 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  Embarrassed

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.
Logged
catchpen
Newbie
*
Offline Offline

Posts: 10


View Profile
« 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 Huh

I also have a "free shipping" tag. Is this screwing it up?
Logged
Pages: 1 2 3 [4] 5 6 7 Go Up Print 
« previous next »
Jump to:  

Recent
[Today at 09:27:47 pm]

[Today at 09:52:21 am]

[September 05, 2010, 11:59:21 am]

[September 05, 2010, 08:55:27 am]

[September 04, 2010, 10:54:28 pm]

[September 04, 2010, 04:50:32 pm]

[September 03, 2010, 09:19:13 pm]

[September 02, 2010, 02:24:17 pm]

[September 01, 2010, 08:36:20 am]

[August 31, 2010, 01:07:25 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
Page created in 0.305 seconds with 20 queries.