TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,236
  • Total Topics: 21,353
  • Online today: 739
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 521
  • Total: 522
  • lurkalot

Awards mod sumary table.

Started by iGate, June 27, 2008, 04:16:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

iGate

hey all.

i love this mod.
http://custom.simplemachines.org/mods/index.php?mod=475

i was wondering if someone could make me a summary page of all the awards plus who has them for use in an article. i know this takes effort so ive tried to help (in non-coding ways).

i want the article to have (in this format):

-----------
i understand that this takes effort, but im hoping it may become easier by copying and pasting some of the code used to produced the page screenshotted below.
http://i123.photobucket.com/albums/o293/iGate/awards.jpg
(i linked to it save bandwidth on forums :D )

okay thanks in advance guys.

PS: if u need more info or anything just post here and ill check back soon.

Dragooon

Try this
// Lists all the awards and shows who have them
global $db_prefix, $modSettings, $boardurl, $scripturl;
// First get all the awards
$request = db_query("
SELECT ID_AWARD, gameName, awardName, filename
FROM {$db_prefix}awards",__FILE__,__LINE__);
$awards = array();
while($row = mysql_fetch_assoc($request))
{
$awards[$row['ID_AWARD']] = array(
'id' => $row['ID_AWARD'],
'name' => $row['awardName'],
'desc' => parse_bbc($row['gameName']),
'image' => $boardurl.'/'.$modSettings['pa_awardsDir'].'/'.$row['filename'],
'members' => array(),
);
$request_mem = db_query("
SELECT mem.ID_MEMBER, mem.realName
FROM {$db_prefix}members AS mem
INNER JOIN {$db_prefix}awards_members AS am ON (am.ID_MEMBER = mem.ID_MEMBER AND am.ID_AWARD = $row[ID_AWARD])",__FILE__,__LINE__);
while($row_mem = mysql_fetch_assoc($request_mem))
$awards[$row['ID_AWARD']]['members'][] = '<a href="'.$scripturl.'?action=profile;u='.$row_mem['ID_MEMBER'].'">'.$row_mem['realName'].'</a>';
mysql_free_result($request_mem);
}
mysql_free_result($request);

// Output it!
echo '
<table cellpadding="6" cellspacing="0" width="100%" border="0" class="bordercolor">';
foreach($awards as $award)
echo '
<tr>
<td colspan="3" class="titlebg">',$award['name'],'</td>
</tr>
<tr>
<td class="windowbg" width="25%"><img src="',$award['image'],'" /></td>
<td class="windowbg" width="25%">',$award['desc'],'</td>
<td class="windowbg">',implode(', ',$award['members']),'</td>
</tr>';
echo '</table>';

iGate

#2
wow dragoon...u are truly awesome.
thanks.

for anyone who wants to see it in action: http://ihf.lp.pl/index.php?page=39
*i did modify the table widths a bit, and centered the images.

A BIG THANKYOU.

one question.
How do u add a header which says "=IHF= Medals" and is centered. ( ihave disbaled "use the theme frame" option in the tp admin to make more space for it.
i tried doing this but it kept coming up for each individual medal, and i wanted it just at the top.

Ken.

Looks great.  :up:

Good job Dragooon & iGate.  :up:
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

IchBin

Add your table or div etc before this line to make it above the output.
<table cellpadding="6" cellspacing="0" width="100%" border="0" class="bordercolor">';

Dragooon


pauls_uk

Thank you so much this is great.Yesterday i made a list of all my members names then u had to click on there name to see what awards they have this is brilliant thank you so much  ;)

pauls_uk

Is there a way this can be edited so when we click on a members name from the awards it shows all there awards rather than there profile?

pauls_uk

I guess there is not a way of doing the above then  ;)

pauls_uk

Sorted this out thanks for getting back to me everyone  :2funny:

This website is proudly hosted on Crocweb Cloud Website Hosting.