Seleccionar idioma:
Realizar Donación - Mods Premium - Portfolio



Este sitio utiliza cookies propias y de terceros. Si continúa navegando consideramos que acepta el uso de cookies. OK Más Información.
* Thank O Matic
  Leído 1006 veces
* Viendo el foro
 0 Usuarios y 1 Visitante están viendo este foro.


*
Sep 23 2014


Hello all,

I am looking to create a list of all the thank you's made. I would like the list to display the last 25 thank you's given, and I want each to display the link of the topic, who gave the thank you, and the date.

Has this already been made? I plan to put this inside a TinyPortal block.

I am using 1.x, but if a 2.x version is made, I wouldn't mind using it either.

Tinyportal
1.x

Mensajes: 7

Ver Perfil 

En línea

*
Sep 24 2014


You want to make a block? Could use SSI functions mod adds.

ssi_thankYouPostTopResived($topMembers = 5, $output_method = 'echo')
ssi_thankYouPostTopGiven($topMembers = 5, $output_method = 'echo')

*¤×•·:.·.:·•×¤* ^HeRaCLeS^ *¤×•·:.·.:·•×¤*
*¤×• Todos los Mp seran ignorados | Solo seran considerados los Mp Solicitados por mi •×¤*
*¤×• All Mp will be ignored | Only considers the Mp requested per my •×¤*

SMFPersonal

Adk Portal 3.0.2
2.0.14
www.smfpersonal.net
#1

Mensajes: 13978

Ver Perfil  SMFPersonal 

En línea

*
Sep 25 2014


No, no. I want a function that displays the last 25 topics that were thank-you'd. :) That function shows the members, which is not important to me.

Tinyportal
1.x
#2

Mensajes: 7

Ver Perfil 

En línea

*
Sep 26 2014


No, there is no function that do that .. Would have to develop it.

*¤×•·:.·.:·•×¤* ^HeRaCLeS^ *¤×•·:.·.:·•×¤*
*¤×• Todos los Mp seran ignorados | Solo seran considerados los Mp Solicitados por mi •×¤*
*¤×• All Mp will be ignored | Only considers the Mp requested per my •×¤*

SMFPersonal

Adk Portal 3.0.2
2.0.14
www.smfpersonal.net
#3

Mensajes: 13978

Ver Perfil  SMFPersonal 

En línea

*
Sep 26 2014


No, there is no function that do that .. Would have to develop it.

Could I pay you 10 dollars paypal to develop it for 1.x?

Tinyportal
1.x
#4

Mensajes: 7

Ver Perfil 

En línea

*
Sep 26 2014


What version do you have of smf and what version do you have of mod?

*¤×•·:.·.:·•×¤* ^HeRaCLeS^ *¤×•·:.·.:·•×¤*
*¤×• Todos los Mp seran ignorados | Solo seran considerados los Mp Solicitados por mi •×¤*
*¤×• All Mp will be ignored | Only considers the Mp requested per my •×¤*

SMFPersonal

Adk Portal 3.0.2
2.0.14
www.smfpersonal.net
#5

Mensajes: 13978

Ver Perfil  SMFPersonal 

En línea

*
Sep 27 2014


What version do you have of smf and what version do you have of mod?

I am using SMF version 1.1.19 and I believe version 1.25 of the mod.

So do you accept my offer? :'(

Tinyportal
1.x
#6

Mensajes: 7

Ver Perfil 

En línea

*
Sep 28 2014


I'll see if these days I can work on this.

*¤×•·:.·.:·•×¤* ^HeRaCLeS^ *¤×•·:.·.:·•×¤*
*¤×• Todos los Mp seran ignorados | Solo seran considerados los Mp Solicitados por mi •×¤*
*¤×• All Mp will be ignored | Only considers the Mp requested per my •×¤*

SMFPersonal

Adk Portal 3.0.2
2.0.14
www.smfpersonal.net
#7

Mensajes: 13978

Ver Perfil  SMFPersonal 

En línea

*
Sep 29 2014


Really looking forward to it. +10 Also, once complete, PM me your PayPal address. :angel:

Tinyportal
1.x
#8

Mensajes: 7

Ver Perfil 

En línea

*
Oct 01 2014


Any update? :(

Unido automaticamente - {Octubre 01, 2014, 02:59:27 am}


Okay, I tried to make this on my own and I got far :)

Código: [Seleccionar]
global $txt, $user_info, $scripturl, $modSettings, $db_prefix, $context, $user_profile, $ID_MEMBER, $sourcedir;

// Is the load average too high to allow searching just now?
if (!empty($context['load_average']) && !empty($modSettings['loadavg_show_posts']) && $context['load_average'] >= $modSettings['loadavg_show_posts'])
fatal_lang_error('loadavg_show_posts_disabled', false);

// Default to 10.
if (empty($_REQUEST['viewscount']) || !is_numeric($_REQUEST['viewscount']))
$_REQUEST['viewscount'] = '10';

$request = db_query("
SELECT COUNT(*)
FROM ({$db_prefix}messages AS m, {$db_prefix}boards AS b)
WHERE b.ID_BOARD = m.ID_BOARD
AND m.thank_you_post = 1
AND $user_info[query_see_board]", __FILE__, __LINE__);
list ($msgCount) = mysql_fetch_row($request);
mysql_free_result($request);

$request = db_query("
SELECT MIN(ID_MSG), MAX(ID_MSG)
FROM {$db_prefix}messages AS m
WHERE m.thank_you_post = 1", __FILE__, __LINE__);
list ($min_msg_member, $max_msg_member) = mysql_fetch_row($request);
mysql_free_result($request);

$reverse = false;
$range_limit = '';
$maxIndex = (int) $modSettings['defaultMaxMessages'];

// Make sure the starting place makes sense and construct our friend the page index.
$context['start'] = (int) $_REQUEST['start'];
$context['page_index'] = constructPageIndex($scripturl . '?action=bestanswers', $context['start'], $msgCount, $maxIndex);
$context['current_page'] = $context['start'] / $maxIndex;

// Reverse the query if we're past 50% of the pages for better performance.
$start = $context['start'];
$reverse = $_REQUEST['start'] > $msgCount / 2;
if ($reverse)
{
$maxIndex = $msgCount < $context['start'] + $modSettings['defaultMaxMessages'] + 1 && $msgCount > $context['start'] ? $msgCount - $context['start'] : (int) $modSettings['defaultMaxMessages'];
$start = $msgCount < $context['start'] + $modSettings['defaultMaxMessages'] + 1 || $msgCount < $context['start'] + $modSettings['defaultMaxMessages'] ? 0 : $msgCount - $context['start'] - $modSettings['defaultMaxMessages'];
}

// Guess the range of messages to be shown.
if ($msgCount > 1000)
{
$margin = floor(($max_msg_member - $min_msg_member) * (($start + $modSettings['defaultMaxMessages']) / $msgCount) + .1 * ($max_msg_member - $min_msg_member));
$range_limit = $reverse ? 'ID_MSG < ' . ($min_msg_member + $margin) : 'ID_MSG > ' . ($max_msg_member - $margin);
}

// Find this user's posts.  The left join on categories somehow makes this faster, weird as it looks.
$looped = false;
while (true)
{
$request = db_query("
SELECT
b.ID_BOARD, b.name AS bname, c.ID_CAT, c.name AS cname, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, IFNULL(mem.realName, m.posterName) AS posterName,
t.ID_MEMBER_STARTED, t.ID_FIRST_MSG, t.ID_LAST_MSG, m.body, m.smileysEnabled,
m.subject, m.posterTime
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
WHERE m.ID_TOPIC = t.ID_TOPIC
AND m.thank_you_post = 1
AND t.ID_BOARD = b.ID_BOARD" . (empty($range_limit) ? '' : "
AND $range_limit") . "
AND $user_info[query_see_board]
ORDER BY m.ID_MSG " . ($reverse ? 'ASC' : 'DESC') . "
LIMIT $start, $maxIndex", __FILE__, __LINE__);

// Make sure we quit this loop.
if (mysql_num_rows($request) === $maxIndex || $looped)
break;
$looped = true;
$range_limit = '';
}

// Start counting at the number of the first message displayed.
$counter = $reverse ? $context['start'] + $maxIndex + 1 : $context['start'];
$context['posts'] = array();
while ($row = mysql_fetch_assoc($request))
{
// Censor....
censorText($row['body']);
censorText($row['subject']);

// Do the code.
$row['body'] = parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']);

// And the array...
$context['posts'][$counter += $reverse ? -1 : 1] = array(
'body' => $row['body'],
'counter' => $counter,
'category' => array(
'name' => $row['cname'],
'id' => $row['ID_CAT']
),
'board' => array(
'name' => $row['bname'],
'id' => $row['ID_BOARD']
),
'topic' => $row['ID_TOPIC'],
'poster' => array(
'id' => $row['ID_MEMBER'],
'name' => $row['posterName'],
'href' => empty($row['ID_MEMBER']) ? '' : $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => empty($row['ID_MEMBER']) ? $row['posterName'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>'
),
'subject' => $row['subject'],
'start' => 'msg' . $row['ID_MSG'],
'time' => timeformat($row['posterTime']),
'timestamp' => forum_time(true, $row['posterTime']),
'id' => $row['ID_MSG'],
);
}
mysql_free_result($request);

// All posts were retrieved in reverse order, get them right again.
if ($reverse)
$context['posts'] = array_reverse($context['posts'], true);

// For every post to be displayed, give it its own subtable, and show the important details of the post.
foreach ($context['posts'] as $post)
{
echo '<table border="0" width="90%" style="table-layout:fixed; margin-bottom: 1ex;" cellspacing="0" cellpadding="4" class="tbordertp" align="center">
<tr>
<td width="7%" class="largetext titlebg" align="center">
', $post['counter'], '
</td>
<td width="73%" class="middletext titlebg">
<a style="text-decoration: none;" href="', $scripturl, '?board=', $post['board']['id'], '.0">
', $post['board']['name'], '
</a> &#187;
<a style="text-decoration: none;" href="', $scripturl, '?topic=', $post['topic'], '.', $post['start'], '#msg', $post['id'], '">
', $post['subject'], '
</a>
</td>
<td width="20%" class="middletext titlebg" align="right">
', $post['time'], '
</td>
</tr>
<tr>
<td style="width: 100%;" height="50" colspan="3" valign="top" class="windowbg2">
<div class="post" style="overflow:hidden; width: 100%; word-break: break-all; padding: 2px 0;">
', $post['body'], '
</div>
</td>
</tr>
<tr>
<td style="width: 100%;" height="50" colspan="3" valign="top" class="windowbg2">
<div class="post" style="overflow:hidden; width: 100%; word-break: break-all; padding: 2px 0;">
', $post['poster']['name'], ' | ', $post['poster']['id'], ' || ', $post['poster']['href'], ' ||| ', $post['poster']['link'], '
</div>
</td>
</tr>
</table>';
}

echo '
<div style="margin-left: 2ex;" class="smalltext">
', $txt[139], ': ', $context['page_index'], '
</div>';

My problem is, I want to order the thank-you's by their date, instead of the message's date. Hope to I combine this table smf_thank_you_post, specifically thx_time column to the query below?

      
Código: [Seleccionar]
$request = db_query("
SELECT
b.ID_BOARD, b.name AS bname, c.ID_CAT, c.name AS cname, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, IFNULL(mem.realName, m.posterName) AS posterName,
t.ID_MEMBER_STARTED, t.ID_FIRST_MSG, t.ID_LAST_MSG, m.body, m.smileysEnabled,
m.subject, m.posterTime
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
WHERE m.ID_TOPIC = t.ID_TOPIC
AND m.thank_you_post = 1
AND t.ID_BOARD = b.ID_BOARD" . (empty($range_limit) ? '' : "
AND $range_limit") . "
AND $user_info[query_see_board]
ORDER BY m.ID_MSG " . ($reverse ? 'ASC' : 'DESC') . "
LIMIT $start, $maxIndex", __FILE__, __LINE__);

Tinyportal
1.x
#9

Mensajes: 7

Ver Perfil 

« Última Modificación: Octubre 01, 2014, 02:59:27 am por shuban »
En línea




Otros temas de su interes

eror on adk blogs when i open new post! pjnet Septiembre 15, 2012, 04:44:58 pm *
adk blog undefined index error: notify nsz Abril 29, 2012, 05:03:25 pm *
Adk Blog - Images Krzysiak[PL] Febrero 28, 2017, 07:20:06 pm *
ADK Blog - BR tags when editing? NekoJonez Mayo 28, 2013, 08:10:11 am
Strange problem with Thanks-o-Matic jure12 Mayo 29, 2017, 11:46:04 pm *
Thank-O-Matic Thank you Button disappeared from some topics ddabcd277 Octubre 27, 2011, 09:21:06 am *



Usuario:
Contraseña:
Sesión: