Pimp up my bookworm

The WoWRoster interface for the WoW AddOn, Bookworm

Moderator: Sahasrahla

Pimp up my bookworm

Postby SethDeBlade » Sat Aug 12, 2006 4:20 pm

I added a litte statistic to my bookworm page. It counts the number of books and pages available. So you have an easier overview if new books are really stored.

Have a look an the bottom of My Bookworm

Open bookworm.php
find
Code: Select all
$result = $wowdb->query($query) or die_quietly($wowdb->error(),'Database Error',basename(__FILE__),__LINE__,$query);


after add
Code: Select all
$nums = mysql_num_rows($result);




find
Code: Select all
$ab = array();


after add
Code: Select all
$pages = 0;




find
Code: Select all
$ab[] = array($row['hash'], $row['title'], $row['num_pages'], $row['found_by'], $row['zone'], $row['subzone']);


after add
Code: Select all
$pages = $row['num_pages'] + $pages;




find
Code: Select all
$tableFooter = '</table>';


replace with
Code: Select all
$tableFooter = '<tr><td colspan="4" class="membersHeader"><center>'.sprintf($wordings[$roster_conf['roster_lang']]['statistics'], $nums, $pages).'</center></td></tr></table>';




Now localization.php

find
Code: Select all
$wordings['enUS']['num_pages'] = '# of pages';


after add
Code: Select all
$wordings['enUS']['statistics'] = 'There are %d books with totally %d pages stored';


find
Code: Select all
$wordings['deDE']['num_pages'] = '# Seiten';


after add
Code: Select all
$wordings['deDE']['statistics'] = 'Es sind insgesamt %d Bücher mit zusammen %d Seiten vorhanden.';
User avatar
SethDeBlade
WR.net Expert
WR.net Expert
 
Posts: 192
Joined: Thu Jul 06, 2006 1:02 am
Location: Germany

Return to Bookworm

Who is online

Users browsing this forum: No registered users and 0 guests

cron