SimplePortal
Customization => Blocks and Modifications => Topic started by: grafitus on March 21, 2010, 11:37:36 AM
-
This block to show need to do in the my To-Do List (http://custom.simplemachines.org/mods/index.php?mod=2445) mod.
Create a new PHP block and add this content:
global $context, $smcFunc;
$request = $smcFunc['db_query']('', '
SELECT subject, time, priority
FROM {db_prefix}to_do
WHERE id_member = {int:member}
LIMIT {int:limit}',
array(
'member' => $context['user']['id'],
'limit' => 5,
)
);
$context['todo'] = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$context['todo'][] = array(
'subject' => $row['subject'],
'time' => $row['time'],
'priority' => $row['priority'],
);
}
$smcFunc['db_free_result']($request);
if (empty($context['todo']))
echo $txt['to_do_empty']; // Free man :D
else
{
foreach ($context['todo'] as $todo)
echo '
', $todo['subject'], ' - <span class="smalltext"><em>', $todo['time'], '</em></span>';
}
-
Good One
-
nice one grafitus ;) I use your to do list mod in my forum and so far is been wonderful, thanks for the block ;)
-
No problem guys. :nervous-happy: I glad you like to the block...
-
I have installed the To Do List and put the block on the right site.
I made something to do, and nothing show up in that block.
Stef.
-
Were you installed new version (To-Do List)? If so, this is very normal. Because, table structure changed on new version. I hope I add appropriate codes in new version.
-
Is this a question about Grafitus' To-Do list block? Or a question about his To-Do list mod?
-
about Grafitus' To-Do list block
-
I think Grafitus is saying that this block code works with the older version of his to-do-list mod, and that he will update it when he has the opportunity.
-
Oke, thanks.
Than i wait for it.
Stef.