News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Tagging System For Topics

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

Previous topic - Next topic

haerde

#500
lets talk about portals later. Vbgamer, are u available to make random tagged cloud ?


EDIT: // And please look at this topic: http://www.simplemachines.org/community/index.php?topic=337577.0

Kimmie

Quote from: stefann on September 19, 2009, 09:49:06 PM
Quote from: haerde on September 17, 2009, 04:58:12 PM
This mod is dead ...
I'm working with vbgamer to make some considerable improvements to this mod, a lot of which have been suggested here. I may post some screenshots later for comments before it's released as there are some fairly major new features, while of course maintaining backwards compatibility.

I assume this means you all are working to fix all the bugs first right? (such as the one several of us posted a month ago) :)

Rhyme

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in Display.template.php on line 1093

I'm getting this error when I try to manually install this to a different skin.  Can I get some help with this, thanks.

Sabre™

Attach that themes display.template.php to your next post
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Rhyme

Quote from: Sabre™ on September 29, 2009, 11:50:26 PM
Attach that themes display.template.php to your next post

I actually figured out what the issue was with that.  Fixed it, but the tags still don't show up on the theme.  I'll have to take another look at it tomorrow.  Nearly 2am now here and I've been looking at codes all afternoon.  Perhaps a good nights rest will make things better in the morning XD

Sabre™

Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Rhyme

Okay I figured out what I have to do here, but in editing the code for the theme I wish to add the tab to, I got an error on this line of code

echo ($current_action == 'tags' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '


It's from this section:


      // the [tags] button
      echo ($current_action == 'tags' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'tags' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=tags">' , $txt['smftags_menu']  , '</a>
            </td>' , $current_action == 'tags' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

      


This is the skin I'm working on, and as you can see at the very top I don't have the tab for the tags.  I have the tagging system itself now working on the skin, but no way of looking at what tags are in place without the tab.  I already added in the 'tag' part to this:

$current_action = 'admin';
   if (in_array($context['current_action'], array(

Besides the line of code that isn't working, what other files would I have to edit on a particular skin to get this mod to work?

Rhyme

Okay, I have everything now in place, I can even see the tab now on my new skin.  However, when I click the tab I'm redirected to the index.

So I still kind of need a little help please.

plusev

I just noticed that in the tag cloud it show the user's name rather than the display name. Could that be changed in the next update? Thx

Rhyme

Just wanted to say after my own tweaking I finally got it to work.  I don't even know how I fixed the problem.  My only problem now is cosmetic.  I have one tag properly in place that looks fine next to my home button.  Doesn't work LOL.  Then next to my logout button, if you squint your eyes really hard you can just make up the text "Tags" in dark gray.  Hardly viewable on my forums skin.  But "hey" at least it works, lol.

If someone would care to take a look at what I mean:

www.vortexshadow.com

I would like to know how to fix this LOL

tarat

If your user doesn't set tags then you should use this code for tag creation from subject:


// if no tags
if($_REQUEST['tags']=='' && !isset($_REQUEST['num_replies']) && isset($_POST['subject']))
{
$tags = explode(' ',htmlspecialchars($_POST['subject'],ENT_QUOTES));
$tagcount = 0;
$new_tags = array();
foreach($tags as $tag)
{
        if($tagcount <= $modSettings['smftags_set_maxtags'] && !empty($tag) && strlen($tag) >= $modSettings['smftags_set_mintaglength'] && strlen($tag) <= $modSettings['smftags_set_maxtaglength'])
        {$new_tags[] = $tag;
         $tagcount= $tagcount +1;
        }

}
if ($tagcount>0)
   {
   $_REQUEST['tags'] = implode (',', $new_tags);
   }
   
}


You can insert into source/post.php before:


// Tagging System

if(isset($_REQUEST['tags']) && !isset($_REQUEST['num_replies']))
{

digit

Quote from: tarat on October 04, 2009, 03:43:50 PM
If your user doesn't set tags then you should use this code for tag creation from subject:

That's a nifty snippet!  Thanks!  8)
Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

digit

I was getting an error with the above snippet - I believe it SHOULD be....


$tags = explode(' ',htmlspecialchars($_POST['subject'],ENT_QUOTES));
$tagcount = 0;
$new_tags = array();
if($_REQUEST['tags']=='' && !isset($_REQUEST['num_replies']) && isset($_POST['subject']))
{

foreach($tags as $tag)
{
        if($tagcount <= $modSettings['smftags_set_maxtags'] && !empty($tag) && strlen($tag) >= $modSettings['smftags_set_mintaglength'] && strlen($tag) <= $modSettings['smftags_set_maxtaglength'])
        {$new_tags[] = $tag;
         $tagcount= $tagcount +1;
        }

}
if ($tagcount>0)
   {
   $_REQUEST['tags'] = implode (',', $new_tags);
   }
   
}

Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

tarat

Why do you put tags, tagcount and new_tags before if?
You will create this 3 variable always.

This line
if($_REQUEST['tags']=='' && !isset($_REQUEST['num_replies']) && isset($_POST['subject']))
checks the relevance: New topic without tags. So it should be the first otherwaise you will create 3 unnecessary variables.

digit

You are right...  and I am still getting the error...

8: Undefined index: tags
File: /users/Sources/Post.php
Line: 1670

This is what I have online 1670.....

if($_REQUEST['tags']=='' && !isset($_REQUEST['num_replies']) &&


Any idea how I can fix that?
Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

akbora

SMF 2.0.13
Default Theme
Utf8 Turkish
---------------

digit

bump....

I sure would like my error log to stop filling up!  Can someone please help me figure out why I am getting the error mentioned above?

Thanks in advance.
Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

Rhyme

Quote from: Rhyme on September 30, 2009, 09:24:00 PM
Just wanted to say after my own tweaking I finally got it to work.  I don't even know how I fixed the problem.  My only problem now is cosmetic.  I have one tag properly in place that looks fine next to my home button.  Doesn't work LOL.  Then next to my logout button, if you squint your eyes really hard you can just make up the text "Tags" in dark gray.  Hardly viewable on my forums skin.  But "hey" at least it works, lol.

If someone would care to take a look at what I mean:

www.vortexshadow.com

I would like to know how to fix this LOL

still looking to fix this problem.

netoya

Rhyme your problem is not in mod but in manual instalation with custom theme, so you are in wrong topic.
Can you send me index.template.php in PM I will try to help.

vbgamer45

Find

   if($_REQUEST['tags']=='' && !isset($_REQUEST['num_replies'])

Change to

   if(@$_REQUEST['tags']=='' && !isset($_REQUEST['num_replies'])
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

Advertisement: