To use this website completely, it is necessary to store cookies on your computer.
 

* Navigator

Expand - Collapse

* Statistic

  • *Total Posts: 14942
  • *Total Topics: 2271
  • *Online Today: 12
  • *Most Online: 292
(2016 November 12, 09:37:31 am)

Tagging System block code

Started by beltazar, 2009 November 27, 09:44:38 pm

previous topic - next topic

0 Members and 0 Guests are viewing this topic.

beltazar

2009 November 27, 09:44:38 pm
Hi,

I'm using Tagging System mod from here http://mods.simplemachines.org/index.php?mod=579
I love that mod and want to add Popular Tags in a portamx block

how is the code to do that ?

thx


feline

#1
2009 November 28, 06:37:48 pm
For this question you have to call the mod author, who the data stored ...

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Cool

#2
2009 November 28, 07:13:38 pm
Code Select

//Tagging System
$dbresult= $smcFunc['db_query']('', "
SELECT
t.tag,l.ID,t.ID_TAG
FROM {db_prefix}tags_log as l, {db_prefix}tags as t
WHERE t.ID_TAG = l.ID_TAG && l.ID_TOPIC = $topic");
$context['topic_tags'] = array();
while($row = $smcFunc['db_fetch_assoc']($dbresult))
{
$context['topic_tags'][] = array(
'ID' => $row['ID'],
'ID_TAG' => $row['ID_TAG'],
'tag' => $row['tag'],
);
}
$smcFunc['db_free_result']($dbresult);
//End Tagging System
 |I Use: SMF 2.0.5 | PortaMx 1.51
Q: What do you do when you see a bear in the woods?
A: Play Dead!
H-A-H-L = Happy Admins Have Linux

Horseman

#3
2009 November 29, 09:40:06 am
Hallo @cool
Ich habe deinen Code eben auch mal in einen Block eingebunden und über den MOD 3 Tags angelegt.
Es wird mir aber kein Tag angezeigt.
PhpOpenChat Support Portal: http://www.phpopenchat.de >SMF 2 RC3 PortaMX 0.980-1 & PmxBlog
Reiter Community: http://www.h-h-c.de >SMF 2 RC3 PortaMX 0.980-1 & PmxBlog

Cool

#4
2009 November 29, 10:18:39 am
das ist nur der code aus dem script, wie dieser verwaltet wird. wenn du dir den mod auf der smf-seite parsen lässt kommst du sicher weiter.
 |I Use: SMF 2.0.5 | PortaMx 1.51
Q: What do you do when you see a bear in the woods?
A: Play Dead!
H-A-H-L = Happy Admins Have Linux

Horseman

#5
2009 November 29, 10:48:26 am
@Cool
Danke für den Hinweis, dachte das wäre der fertige Code für den Block ;-)

Schönen 1. Advent allen PortaMX Mitgliedern auf diesem Weg wünscht!

Gruß
Horseman
PhpOpenChat Support Portal: http://www.phpopenchat.de >SMF 2 RC3 PortaMX 0.980-1 & PmxBlog
Reiter Community: http://www.h-h-c.de >SMF 2 RC3 PortaMX 0.980-1 & PmxBlog

Horseman

#6
2009 November 29, 11:01:30 am
@beltazar
Der von dir bei SMF gepostete Code funktioniert doch  :D

Gruß
Horseman
PhpOpenChat Support Portal: http://www.phpopenchat.de >SMF 2 RC3 PortaMX 0.980-1 & PmxBlog
Reiter Community: http://www.h-h-c.de >SMF 2 RC3 PortaMX 0.980-1 & PmxBlog

beltazar

#7
2009 December 11, 05:27:47 am
I try this code and it works

Code Select

global $sourcedir, $txt, $context, $scripturl;

require_once($sourcedir . '/Tags2.php');
ViewTags();

if (isset($context['poptags']))
echo $context['poptags'];



Fadi

#8
2010 January 05, 10:59:35 pm
i have created a block with this coding in PHP block after created this my site is noww opening completely i have attached the screenshot please help me  :'( how to solve this Please Help on every page i m getting this and after this line there is not more page and nothing else page stop loading... please help

[attachment deleted by admin]

Fadi

#9
2010 January 05, 11:10:57 pm
Code Select
   //Tagging System
   $dbresult= $smcFunc['db_query']('', "
   SELECT
      t.tag,l.ID,t.ID_TAG
   FROM {db_prefix}tags_log as l, {db_prefix}tags as t
   WHERE t.ID_TAG = l.ID_TAG && l.ID_TOPIC = $topic");
      $context['topic_tags'] = array();
       while($row = $smcFunc['db_fetch_assoc']($dbresult))
         {
            $context['topic_tags'][] = array(
            'ID' => $row['ID'],
            'ID_TAG' => $row['ID_TAG'],
            'tag' => $row['tag'],
            );
      }
   $smcFunc['db_free_result']($dbresult);
   //End Tagging System


i used this code in block  :'(

feline

#10
2010 January 05, 11:17:29 pm
Add the line
Code Select

global $context, $smcFunc;

at the top of you code

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Eclipse16V

#11
2012 February 11, 08:03:01 am
Hallo,

habe diesen Code bei mir eingebaut nur jetzt wird keine Sprache geladen.
Quote from: beltazar ,  2009 December 11, 05:27:47 am
I try this code and it works

Code Select

global $sourcedir, $txt, $context, $scripturl;

require_once($sourcedir . '/Tags2.php');
ViewTags();

if (isset($context['poptags']))
echo $context['poptags'];


Wie bekomme ich es hin das auch Tag.german-utf8.php geladen wird?

Danke

feline

#12
2012 February 11, 12:52:35 pm
Die Sprachdateien werden normalerweise mit
loadLanguage('FileName')
geladen. In deinem Fall also mit loadLanguage('Tag') ...
Many are stubborn in relation to the path, a few in relation to the target.

Eclipse16V

#13
2012 February 11, 01:16:03 pm
Danke

Achso, Tags und nicht Tag.  ::)

feline

#14
2012 February 11, 08:52:43 pm
Quote from: Eclipse16V ,  2012 February 11, 08:03:01 am
Wie bekomme ich es hin das auch Tag.german-utf8.php geladen wird?

Wenn die Datei Tags heißt ...  ;D
Many are stubborn in relation to the path, a few in relation to the target.