251

(5 replies, posted in Programming)

I know how to format an UNIX timestamp for the output, but I don't know how to make a timestamp from a date in e.g. the format "m-d-y".
How can I do that?

Here you go:
http://www.punres.org/desc.php?pid=108

253

(25 replies, posted in PunBB 1.2 discussion)

You could play with the template main.tpl

Of course, you can use the Miniportal or other mods from www.PunRes.org like PunFrontpage, PunPortal, oder MegaPun

255

(10 replies, posted in Programming)

Ok, thanks, I will read it soon.
I just got it working, though.

256

(10 replies, posted in Programming)

Please --- can somebody help???

I think there has been something like that before. Try to search here and at http://www.punres.org

Thanks for the fixing. I will include it in the next version... Sorry for my ignorance, I am on vacation and actually using a friend's pc right now.
Thanks again

259

(10 replies, posted in Programming)

another question:
I wanna create a stats page that pulls the names of the players from the players table, and for that player, it pulls the stats from a table gamestats (using player_id and an inner join), but there will be one row per game in the table gamestats, and I want it to add those together.
Could somebody give me a query for that?

Thanks

260

(0 replies, posted in PunBB 1.2 discussion)

Will there be the opportunity to have a sidebar or a portal in 1.3 - without mods.
Would that just be done with the new style system (each style has its own template)? If that is the case, could I ask for a portal style preinstalled / in the package?

261

(1 replies, posted in PunBB 1.2 bug reports)

I think this is kinda annoying...
When you click on a new topic on the frontpage, you always jump automatically to the latest post, except on topics with more than one page, then it just jumps to the beginning. I am not sure but that probably has something to do with action=new, so it is an actual punBB-"problem".
Could that be fixed?

262

(4 replies, posted in PunBB 1.2 show off)

I don't know, the font is kinda small.

263

(7 replies, posted in PunBB 1.2 discussion)

This should do it:
http://www.punres.org/desc.php?pid=240

Just do it the good old way and make a simple php form that sends an email to you...

If you want, you can surely change the design, but I don't see a reason for this design being scary in any way. If there aren't any other requests in the same direction, I won't change it.
But still, thank you for your interest.
And also, do you think I should put more information in the post log (like in your screenshot). I would be willing to do that...

266

(4 replies, posted in Programming)

Thanks, Strofanto.
Can anybody else help?

First, find:

$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' AND p.deleted=0 ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

Replace with:

$result = $db->query('SELECT u.email, u.title, u.real_name, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' AND p.deleted=0 ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

And then, find:

<dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>

And add before:

<dd class="usertitle"><strong><?php echo $cur_post['real_name'] ?></strong></dd>

That should do it.

EDIT: All that in viewtopic.php, of course.

268

(10 replies, posted in Programming)

Another question:
http://www.bydebrasdesigns.com/baseball/records.htm
How can I put that into a MySQL table? I thought about doing it like that:

record_name
record_value
record_year
player_id

What do I do if there are more than one person holding one record (and there are some, look at the link)

EDIT: Can I do something like arrays in MySQL tables?

Do you mean the username by id?

270

(10 replies, posted in Programming)

Yeah, my problem would be all the connections. For example, I have a player table and for every game I want stats for every player. The thing is only a few players from the database will be active, because they play a maximum of 4 years (high school team). I don't know - is it possible to create a static html file from a form? Then I could just let somebody enter the game data and it would automatically create the game report file...

271

(4 replies, posted in Programming)

Why do the changes have to be made Strofanto? Just asking, cuz...
Now I have a blank white screen... sigh

272

(10 replies, posted in Programming)

Well, I mean like game reports and stuff. Score by innings for every game, and so on...
Does anybody have any ideas on how to do that?

273

(5 replies, posted in Programming)

Yeah, you are a genius! Thanks for the help lol

274

(4 replies, posted in Programming)

I am working on the following substitution in header.php, but something is wrong:

// START SUBST - <playeroftheweek>
$myquery = $db->query('SELECT p.first_name, p.last_name, w.text FROM '.$db->prefix.'potw AS w INNER JOIN '.$db->prefix.'players AS p ON p.id=w.player_id WHERE w.recent=1') or error('Unable to fetch player of the week info', __FILE__, __LINE__, $db->error());
if ($db->result($myquery))
{
$playeroftheweek = $db->fetch_assoc($myquery);
$tpl_temp = '<div id="playeroftheweek">'."\n\t\t\t".'<h5>PLAYER OF THE WEEK</h5><h6>'.$playeroftheweek[first_name].' '.$playeroftheweek['last_name'].'</h6><p id="player">'.$playeroftheweek['text'].'</p>'."\n\t\t".'</div>';
}

$tpl_main = str_replace('<playeroftheweek>', $tpl_temp, $tpl_main);
// END SUBST - <playeroftheweek>

What am I doing wrong? First, the query doesn't return any results (which it should - at least one) and second, I have a pun_include behind the <playeroftheweek> tag in my template, but that doesn't show up.

Please help!

275

(5 replies, posted in Programming)

Check at http://bydebrasdesigns.com/baseball first. It's the same, just static pages...