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

* Navigator

Expand - Collapse

* Statistic

  • *Total Posts: 16403
  • *Total Topics: 2518
  • *Online Today: 8
  • *Most Online: 292
(12. Nov 2016, 09:37:31)
  • *Users: 0
  • *Guests: 0
  • *Spiders: 1
  • *Total: 1

  • *Yahoo!

Tagging System block code

Started by beltazar, 27. Nov 2009, 21:44:38

previous topic - next topic

0 Members and 0 Guests are viewing this topic.

Go Down

beltazar

27. Nov 2009, 21:44:38
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
28. Nov 2009, 18:37:48
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
28. Nov 2009, 19:13:38
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
29. Nov 2009, 09:40:06
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
29. Nov 2009, 10:18:39
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
29. Nov 2009, 10:48:26
@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
29. Nov 2009, 11:01:30
@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
11. Dec 2009, 05:27:47
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
05. Jan 2010, 22:59:35
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
05. Jan 2010, 23:10:57
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
05. Jan 2010, 23:17:29
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
11. Feb 2012, 08:03:01
Hallo,

habe diesen Code bei mir eingebaut nur jetzt wird keine Sprache geladen.
Quote from: beltazar on 11. Dec 2009, 05:27:47
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
I work with SMF 2.0.9:
Tornado Map
Default Theme
German & English Languages

feline

#12
11. Feb 2012, 12:52:35
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
11. Feb 2012, 13:16:03
Danke

Achso, Tags und nicht Tag.  ::)
I work with SMF 2.0.9:
Tornado Map
Default Theme
German & English Languages

feline

#14
11. Feb 2012, 20:52:43
Quote from: Eclipse16V on 11. Feb 2012, 08:03:01
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.

Go Up