News: April 1st, 2012, A Day That Will Live in Infamy ~~ TinyPortal 1.0 Final Released!  GET IT NOW !!!
To Read More About It, Just Click Here!

Login  |  Register
* *

Welcome !!!

Welcome, Guest. Please login or register.
Did you miss your activation email?
Please welcome kohai.raul, our newest member.

 
 

Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2015, 01:52:49 PM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 175245
  • Total Topics: 19927
  • Online Today: 89
  • Online Ever: 383
  • (January 02, 2015, 05:58:49 AM)
Users Online
Users: 0
Guests: 48
Total: 48

Please read the Posting Guidelines


Recent Posts

Pages: [1] 2 ... 10
1
Resources / About TPtags, search engine
« Last post by kohai.raul on Today at 11:59:35 AM »
Hi all!


I'm testing the Tags module, included into TinyPortal. It seems not integrated with the search engine. Is it right?

And I don't understand how can I link to a by-tag results page.

Are there some code or mod to achieve these two things?

I would appreciate your advice
2
Block Codes / Re: TPTAG Cloud Snippet
« Last post by kohai.raul on Today at 11:28:46 AM »
Hi all!!

Finally, I realized what the error was.

Quote
$result =

 ...
   GROUP BY t.tag
   ORDER BY t.tag DESC LIMIT {int:limit}',
   array('limit' = 50)
);

should be

Quote
array('limit' => 50)

so, an appropiate snippet could be:

Code: [Select]
global $scripturl, $smcFunc,$db_prefix,$db_connection;

$query='SELECT t.subtype AS tag, t.subtype AS idtag,COUNT(t.subtype) AS quantity
FROM {db_prefix}tp_variables AS t
WHERE t.type = \'globaltag_item\' 
AND t.value3=\'tpadmin_topictags\'
GROUP BY t.subtype
ORDER BY t.subtype
DESC LIMIT {int:limit}';

$resultTags = $smcFunc['db_query']('', $query,array('limit' => 50));

$tags = array();
$tags2 = array();

while ($row = $smcFunc['db_fetch_assoc']($resultTags))
{
$tags[$row['tag']] = $row['quantity'];
$tags2[$row['tag']] = $row['idtag'];
}


if(count($tags2) > 0)
{

$max_size = 250; // max font size in %
$min_size = 100; // min font size in %

$max_qty = max(array_values($tags));
$min_qty = min(array_values($tags));

$spread = $max_qty - $min_qty;
if (0 == $spread)
{ // we don't want to divide by zero
$spread = 1;
}

$step = ($max_size - $min_size)/($spread);

$poptags = '';
$row_count = 0;
foreach ($tags as $key => $value)
{
               $linkcontent="";
$row_count++;
$size = $min_size + (($value - $min_qty) * $step);
// uncomment if you want sizes in whole %:
// $size = ceil($size);

                //THE FOLLOWING LINK ISN'T CORRECT!!!! IS THE ONLY THING I NEED TO 
$linkcontent = '' . $scripturl . '?action=tags;id=' . $tags2[$key] . '" style="font-size: '.$size.'%"';
$linkcontent .= ' title="'.$value.' things tagged with '.$key.'"';
$poptags .= '<a '.$linkcontent.'>'.$key.'</a> ';
if ($row_count > 5)
{
$poptags .= '<br />';
$row_count =0;
}
}
}

echo $poptags;

mysql_free_result($resultTags);


This way I can see the Cloud on frontpage :-) but for now, the generated link for each tag is not correct. .

I need to find out how to generate the appropiate link. How should be the link to load a by-tag page results?

Best Regards,
3
Support / Re: Wherefor did I go wrong?
« Last post by sturmkatze on May 26, 2015, 12:59:11 PM »
It was not like a hooker hanging out on a street corner, more like Bruce Jenner hiding out. My friend found it. There was no 1 it was where I took out the other code and somehow dx-ed  a ' ' . Sorry, me not programmer. On the other hand, been doing neat css stuff...

Thanks for the help offered. :-)
4
Support / Re: Left block calendar ??? - Updated 4/16/2011
« Last post by sturmkatze on May 26, 2015, 08:52:07 AM »
The intent was not to hijack a "dead thread" especially since it had recent activity, I just wanted to make sure the code would work, and it did. Thank you!! :-)
5
Support / Re: Left block calendar ??? - Updated 4/16/2011
« Last post by ZarPrime on May 25, 2015, 12:53:17 PM »
I believe the code we are using here is at the bottom of the first page of this topic but you are correct, this thread is old and was marked solved a long time ago. It works fine with SMF 2.X and the latest TP. Try it and see if it works for you but if it doesn't, please start a new topic rather than hijacking a long dead thread.
6
Block Codes / TPTAG Cloud Snippet
« Last post by kohai.raul on May 25, 2015, 04:08:43 AM »
Hi!!

I'm a new user of TinyPortal. I'm trying to set up the next version of our forum, and just now I'm looking for a Tag Cloud (or snippet) for TPTags module. I don't found at all,  other than for Tagging System Mod in the following thread:

http://www.tinyportal.net/index.php?topic=13744.0

So, I'm trying to "replicate" this snippet exclusively for TPTag module.

By exploring TinyPortal's database structure and considering the thread above, I decided to use the following query, specially for "topics":

Code: [Select]
SELECT t.subtype AS tag, t.subtype AS idtag,COUNT(t.subtype) AS quantity
FROM {db_prefix}tp_variables AS t
        WHERE t.type = 'globaltag_item'
        AND t.value3='tpadmin_topictags'
GROUP BY t.tag
ORDER BY t.tag DESC LIMIT 50

 
So the first snippet that I tried to test (into a TP block) was:

Code: [Select]
global $scripturl, $smcFunc;

$result = $smcFunc['db_query']('','SELECT t.subtype AS tag, t.subtype AS idtag,COUNT(t.subtype) AS quantity
FROM {db_prefix}tp_variables AS t
        WHERE t.type = \'globaltag_item\'
        AND t.value3=\'tpadmin_topictags\'
GROUP BY t.tag
ORDER BY t.tag DESC LIMIT {int:limit}',
array('limit' = 50)
);

$tags = array();
$tags2 = array();

while ($row = $smcFunc['db_fetch_array']($result))
{
$tags[$row['tag']] = $row['quantity'];
$tags2[$row['tag']] = $row['idtag'];
}

$smcFunc['db_free_results']($result);

print_r("Prueba lista tags:".$tags2);

... But obtained NO results!! ... no message :-/

I found traces in logs as the following ones, but I don't know if they're related with my snippet:

Quote

http://develop.fuentedepermacultura.org/index.php?
8: Undefined index: REQUEST_URL
Archivo: /var/www/vhosts/fuentedepermacultura.org/develop/Sources/Subs.php
Línea: 3046

http://develop.fuentedepermacultura.org/index.php?pretty;action=admin&amp;area=packages;sa=installed;be37ac7bc5=a9a12e7142170ca87f4ecc0514dfe207
8: Undefined index: sub_buttons
Archivo: /var/www/vhosts/fuentedepermacultura.org/develop/Themes/default/languages/TPortal.spanish_es.php (body_above sub template - eval?)
Línea: 400


Someone knows what's happening with this snippet and/or logged errors??

I will appreciate your help!! :-)

Looking forward to hearing from you,

-- EXTRA INFO --

Link to my forum: http://foro.fuentedepermacultura.org
SMF version: SMF 2.0.4
TP version: TP 1.107
Default Forum Language: spanish_es
Theme name and version: Reseller Responsive
Browser Name and Version: Firefox 37.0.2 4Ubuntu
Mods installed: View Single Category_2.4; Post Scheduler_1.0.1; External and NoFollow All Links_1.0.0; Downloads System_2.1a; Responsive Curve_1.0 Beta 3; Team Page_4.0.1; Simple Audio Video Embedder_3.1; Additional Topic Authors_0.1.1; Pretty URLs_1.1.2; SMFBlog_2.0; TinyPortal_1.107; Ad Seller Pro_2.5.1a; SMF Links Directory_2.3.2; AdditionalMembergroups_1.02; Optimus Brave_1.8.7; SEO Sitemap_2.2.1; SMF 2.0.4 Update_1.0; SMF 2.0.3 Update_1.0; Hide Tag Special_3.0; Embed BBCode_1.5; Bookmarks_2.5; Stop Spammer_2.3.9; reCAPTCHA for SMF_0.9.8a

-- COMMENT UPDATES --

May, 25

The SQL query has an error. The query should be (tested on phpmyadmin):

Code: [Select]
$query='SELECT t.subtype AS tag, t.subtype AS idtag,COUNT(t.subtype) AS quantity
FROM {$db_prefix}tp_variables AS t
WHERE t.type = \'globaltag_item\' 
AND t.value3=\'tpadmin_topictags\'
GROUP BY t.subtype
ORDER BY t.subtype
DESC LIMIT {int:limit}';

1st - Testing the following code into a block on frontage:

Code: [Select]
global $scripturl, $smcFunc,$db_prefix;

$query='SELECT t.subtype AS tag, t.subtype AS idtag,COUNT(t.subtype) AS quantity
FROM {$db_prefix}tp_variables AS t
WHERE t.type = \'globaltag_item\' 
AND t.value3=\'tpadmin_topictags\'
GROUP BY t.subtype
ORDER BY t.subtype
DESC LIMIT {int:limit}';

print_r($query);

RESULT:  I can read/see the query on webpage

2nd - the second test:

Code: [Select]
global $scripturl, $smcFunc,$db_prefix;

$query='SELECT t.subtype AS tag, t.subtype AS idtag,COUNT(t.subtype) AS quantity
FROM {$db_prefix}tp_variables AS t
WHERE t.type = \'globaltag_item\' 
AND t.value3=\'tpadmin_topictags\'
GROUP BY t.subtype
ORDER BY t.subtype
DESC LIMIT {int:limit}';

print_r($query);

$resultTags = $smcFunc['db_query']('', $query,array('limit' = 50));

print_r($resultTags);

RESULT:
the block content is totally empty!!

Seems it my forum doesn't accept the smcFunc instance????

:-?
7
Support / Re: Wherefor did I go wrong?
« Last post by sturmkatze on May 22, 2015, 08:55:45 AM »
Could be a variable or something. You'll need to attach your file if you want us to figure it out.
By your command
8
Support / Re: Wherefor did I go wrong?
« Last post by IchBin™ on May 21, 2015, 07:36:19 PM »
Could be a variable or something. You'll need to attach your file if you want us to figure it out.
9
Support / Re: Wherefor did I go wrong?
« Last post by sturmkatze on May 21, 2015, 04:29:21 PM »
Yeah, I did. Sadly, I was lazy and changed it from inside SMF/TP. D'OH! It was the index.template, I know that, was right around line 160 or so.... But I don't see it. Been driving me nuts.
10
Support / Re: Wherefor did I go wrong?
« Last post by WillyP on May 21, 2015, 03:59:55 PM »
If you look at the source of your page that '1' is just hanging out like a hooker on a street corner. Look through your source files that you changed whilst following the directions you got from the SMF site, and remove the errant digit.
Pages: [1] 2 ... 10