Tagging System For Topics

Started by SMFHacks.com Team, December 19, 2006, 10:59:20 AM

Previous topic - Next topic

studiowi33

How do I add capital letters? All my tags are in lower case and I'm too dumb to try to fix it myself.

Any help in this matter is appreciated.

-s.w
SMF 2.0.2

mabley

Here is what I have noticed about capitol letters and punctuation.


  • If you FIRST CREATE the tag WHEN YOU CREATE THE POST or in a REPLY, the capitalization and punctuation will be entered just like you want.
  • The ORIGINAL capitalization will now PERSIST even if you add tags with different capitalization.
  • If you first create the tag in the [Add Tag] thing at the bottom of the thread, then it will IGNORE CAPITALIZATION and that will persist for any new entries of that tag.
  • Apostrophes ' like in O'Malley or Sarah's Socks will DIE HORRIBLE DEATHS if you add the tag in the topic view. [Add Tag]  Even if they were originally entered correctly in the Post View, they will still die if you try to add it in the topic view.

If you want to change a tag to capital letters you have to go find all the lowercase tags, delete them all, and create a NEW tag with the proper capitals in the Post View.



vbgamer45

Quote from: studiowi33 on November 30, 2011, 12:20:40 PM
How do I add capital letters? All my tags are in lower case and I'm too dumb to try to fix it myself.

Any help in this matter is appreciated.

-s.w
The mod is built to make everything lowercase to avoid duplicate tags for the same word.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

live627

QuoteApostrophes ' like in O'Malley or Sarah's Socks will DIE HORRIBLE DEATHS if you add the tag in the topic view. [Add Tag]  Even if they were originally entered correctly in the Post View, they will still die if you try to add it in the topic view
The data isn't escaped prior to going in the database.


Workaround: Escape  it yourself. Thus, an apostrophe shooed get a backslash prepended to it, like this: \'

mabley

What do you mean, Live627?

I could enter Sarah\'s Socks and it'd go in right? Or what?

studiowi33

U guys are AWEsome!

Thanks mabley, vbgamer, and live627.
Much better tags.

-s.w
SMF 2.0.2

live627

Quote from: mabley on November 30, 2011, 05:45:14 PM
What do you mean, Live627?

I could enter Sarah\'s Socks and it'd go in right? Or what?
Yes. And it would appear correctly, too. Sarah\'s socks => Sarah's socks.

studiowi33

Quote from: live627 on November 30, 2011, 09:29:35 PM
Quote from: mabley on November 30, 2011, 05:45:14 PM
What do you mean, Live627?

I could enter Sarah\'s Socks and it'd go in right? Or what?
Yes. And it would appear correctly, too. Sarah\'s socks => Sarah's socks.
But (with my forum) this only works with tags entered in the Tags box directly under the Title of a POST or REPLY. It doesn't work with the [Add Tag] thing at the bottom of a thread.

-s.w
SMF 2.0.2

sharks

vbgamer45, is there an ETA for the next bug fix release?

vbgamer45

I am waiting on receiving the code for the updated version of tagging system have a sent a pm waiting for a reply.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Lolafish

Just had this installed today..awesome mod!!!!  Since I run Simple Portal, I am having my tags show up in a block that I created, so.....can I remove the menu button that the mod automatically installs without messing anything up?  I don't need it now.  Thanks!

AquaPuppies - A Goldfish Community
www.aquapuppies.com

Running SMF 2.0.2 & SimplePortal 2.3.5

TGB

Quote from: Lolafish on December 03, 2011, 08:14:06 PM
Just had this installed today..awesome mod!!!!  Since I run Simple Portal, I am having my tags show up in a block that I created, so.....can I remove the menu button that the mod automatically installs without messing anything up?  I don't need it now.  Thanks!

Do you mind sharing your block code, I might use it if thats ok.
www.dreamcasthaven.com <----- Running SMF 1.1.16 & heavily modified
www.psxhaven.com <----- Running SMF 1.1.16 & heavily modified
www.romhaven.info <----- Running SMF 1.1.16 & heavily modified
www.bthaven.com <----- Running TT 2.06

Guillelmus

#912
Quote from: jswift on November 25, 2011, 01:00:42 AM
I would like to enable users to select tags from a list. Any tips on how to do this?
You may test this


In Post.template.php replace the portion "// Tagging system Mod" to "//End Tagging system mod" with the following
// Tags mod with cloud

if(!isset($context['num_replies']))
{
echo '

<dt>
<b>', $txt['smftags_topic'], '</b>
</dt>
<dd>
<input type="text" name="tags"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" />
<br /><span class="smalltext">', $txt['smftags_seperate'], '</span>
</dd>

<script language="JavaScript" type="text/JavaScript">

function AddItem(ItemId)
{
document.postmodify.tags.value = document.postmodify.tags.value + ItemId + \',\';
}

</script>';


require_once('Tags2.php');
ViewTags();
  foreach ($context['alltags'] as $key => $value) echo '<a href="#" onclick="AddItem(\''.$key.'\')">'.$key.'</a> ';

}


//End Tagging system mod


In Tags2.php add this to somewhere

$context['alltags'] = $tags;

for example after the text // loop through our tag array

Guillelmus

BUG REPORT:

In Post.template.php
      if(!isset($context['num_replies']))
should be replaced with
      if(!isset($context['previous_posts']))


-> Show tags only when posting a new message. Currently shows also when replying, but this makes no sense.

Lolafish

Quote from: TGB on December 04, 2011, 02:09:00 PM
Quote from: Lolafish on December 03, 2011, 08:14:06 PM
Just had this installed today..awesome mod!!!!  Since I run Simple Portal, I am having my tags show up in a block that I created, so.....can I remove the menu button that the mod automatically installs without messing anything up?  I don't need it now.  Thanks!

Do you mind sharing your block code, I might use it if thats ok.

I don't own the code...got it from the Simple Portal website, but it works perfectly:

Quoteglobal $context, $txt, $mbname,$scripturl, $user_info, $smcFunc,  $modSettings;

       // Tag cloud from http://www.prism-perfect.net/archive/php-tag-cloud-tutorial/
       $result = $smcFunc['db_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 " .  $modSettings['smftags_set_cloud_tags_to_show']);

       // 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 = $smcFunc['db_fetch_assoc']($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 = $modSettings['smftags_set_cloud_max_font_size_precent']; // max font size in %
          $min_size = $modSettings['smftags_set_cloud_min_font_size_precent']; // 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;tagid=' . $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 > ($modSettings['smftags_set_cloud_tags_per_row']-1))
             {
                $context['poptags'] .= '<br />';
                $row_count =0;
             }
              // notice the space at the end of the link
          }
       }


       // Find Results
       $dbresult = $smcFunc['db_query']('', "
       SELECT DISTINCT l.ID_TOPIC, t.num_replies,t.num_views,m.id_member,m.poster_name,m.subject,m.id_topic,m.poster_time,  t.id_board
       FROM ({db_prefix}tags_log as l,{db_prefix}boards AS b, {db_prefix}topics as t, {db_prefix}messages as m)
      WHERE b.ID_BOARD = t.id_board AND l.ID_TOPIC = t.id_topic AND t.approved = 1 AND t.id_first_msg = m.id_msg AND " . $user_info['query_see_board'] . " ORDER BY l.ID DESC LIMIT 20");

       $context['tags_topics'] = array();
       while ($row = $smcFunc['db_fetch_assoc']($dbresult))
       {
             $context['tags_topics'][] = array(
             'id_member' => $row['id_member'],
             'poster_name' => $row['poster_name'],
             'subject' => $row['subject'],
             'id_topic' => $row['id_topic'],
             'poster_time' => $row['poster_time'],
             'num_views' => $row['num_views'],
             'num_replies' => $row['num_replies'],
            
             );
       }
       $smcFunc['db_free_result']($dbresult);
echo'
<center>';
if (isset($context['poptags']))
        echo $context['poptags'];
echo'
</center>';

AquaPuppies - A Goldfish Community
www.aquapuppies.com

Running SMF 2.0.2 & SimplePortal 2.3.5

Guillelmus

Quote from: Lolafish on December 04, 2011, 07:31:03 PM
Quote from: TGB on December 04, 2011, 02:09:00 PM
Quote from: Lolafish on December 03, 2011, 08:14:06 PM
Just had this installed today..awesome mod!!!!  Since I run Simple Portal, I am having my tags show up in a block that I created, so.....can I remove the menu button that the mod automatically installs without messing anything up?  I don't need it now.  Thanks!

Do you mind sharing your block code, I might use it if thats ok.

I don't own the code...got it from the Simple Portal website, but it works perfectly:

More simply put:
global $sourcedir, $txt, $context, $scripturl;
require_once($sourcedir . '/Tags2.php');
ViewTags();
if (isset($context['poptags'])) echo $context['poptags'];

Grimedth




Don't you wanna make a Tagging System For POSTS mod too? :) It would be just wonderful, if I click on a tag, and then see all of the posts (date sorted and) tagged with that tag :)

vbgamer45

Quote from: Grimedth on December 06, 2011, 11:51:59 AM



Don't you wanna make a Tagging System For POSTS mod too? :) It would be just wonderful, if I click on a tag, and then see all of the posts (date sorted and) tagged with that tag :)
Maybe one day.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

GK777

I have a problem with this mod.

I installed it and it showed me after I wanted to reply to a topic:

QuoteTemplate Parse Error!

There was a problem loading the /Themes/default/Post.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.




Parse error: syntax error, unexpected T_STRING in .../Themes/default/Post.template.php on line 206
197:    echo '
198:                   <dt>
199:                      <span', isset($context['post_error']['no_subject']) ? ' class="error"' : '', ' id="caption_subject">', $txt['subject'], ':</span>
200:                   </dt>
201:                   <dd>
202:                      <input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" class="input_text" />
203:                   </dd>';
204:       ';
205:       // Tagging system Mod
206:       if(!isset($context['num_replies']))
207:       {
208:       echo '
209:       <dt>
210:                                  <b>', $txt['smftags_topic'], '</b>


What can I do to fix this error? I already deleted the mod but nothing has changed.

live627


Advertisement: