Hi!
I have created a game journal for my game Space Zoo. It doesn't seem to be linked to my user page. What have I done wrong?
Best regards, Erik
They can be "viewed" from top link "Game Journals"... They are not linked to your user account. Only BLOGS are linked...
That's why I blog rather than post "Game Journals".
FYI.
richdurham
He might be able to help - if it's a bug.
I'm looking in to it, and forwarding the request to our more drupal oriented admin. In the mean time, if anyone here knows PHP code and can see something wrong with this without knowing whether the references are right (eg. to the node.type of "gamejournal" which is correct) then let me know and I can implement:
```
<?php
/**
* Creates a quicklist of recent game journals and a link to their
* node.
*
* To increase the length of the list, change $listlength
*
*/
global $user;
global $node;
$listlength="20";
preg_match("/\/user\/([0-9]*).*$/", request_uri(), $matches);
$tempuid = $matches[1];
$sql = "SELECT node.nid, node.title, node.created, users.name, node.uid FROM node INNER JOIN users WHERE node.uid = $tempuid AND users.uid=$tempuid AND node.status = 1 AND (node.type='gamejournal') ORDER BY name DESC LIMIT 10";
$numrows = 0;
$result = db_query($sql);
$output .= "<table><tbody>";
while ($sqlnode = db_fetch_object($result)) {
$year = format_date($sqlnode->created, 'custom', 'Y');
$month_day = format_date($sqlnode->created, 'custom', 'M j');
if ($year != $prev_year) {
$output .= "</tbody></table><h3>$year</h3><table><tbody>";
$prev_year = $year;
}
$output .= "<tr><td>". $month_day . " " . "</td><td>" . l($sqlnode->title, "node/$sqlnode->nid") . " ";
$output .= "</td><td><em>Submitted by " . $sqlnode->name . "</em><br/></td>";
$numrows++;
}
$output .= "</tbody></table>";
if (0 == $numrows)
{
$output = "<table><tr><td>No game journals created.</td></tr></table>";
}
print $output;
?>
```
It's obvious the code returns NO RECORDS, because the while-loop would increment then $numrows by 1. So it's got to be something with the SQL.
Looking at the SQL, I can see nothing blatantly wrong, but some things that should be checked.
That's the two (2) places I would look first.
Cheers!
I am currently learning PHP for school. My only question would be why you have a curly braket after the first if has already been closed. Unless there is supposed to be an else statement? Not sure. My bet is that some how your $ numrows variable is getting past the loop and going straight to the last if statement.
Again I'm a sstudent so I could be talking complete nonsense. Lol.
***edit***
answered my own question. I forgot the while loop braces. Whoops.
Thanks for the look-through, guys. Questccg - the node.type being "gamejournal" all lowercase like that with one word is indeed the machine-readable name stored for that node. I'll try wiggling the node.status to see if that makes a difference.
Short is, this code is when a user looks at their personal profile, they see a block on the left about their game journals. The code retrieves the journals they've created and lists them. That's it.
If none were created, it says so ($numrows == 0)
But it doesn't seem to be working.
Dymino Monsters Update 4-18-2024 (0) by Stormyknight1976 |
Hidden Movement: What Makes it Cool? (18) by questccg | |
Wizardry Legacy: the Forgotten Academy (12) by larienna |
TradeWorlds — Tactical Core (3) by questccg | |
Introducing, Jacob! (that's me by the way...) (0) by Jacob | |
Chat GPT: Testing as a design assistant (8) by larienna |
Winner Announced for the Meta Progression Community Challenge! (0) by The Game Crafter |
Hi guys ~ Gameland and Yaofish are officially accepting board game design submissions! (1) by questccg |
A programmer's dilemma (16) by larienna |
Qubits: a solo trick taking game (9) by Wobt2 |
Worker placement, Role selection and Action cards: Is it the same thing? (11) by larienna |
Site Ads and Google Experiments (0) by questccg |
TradeWorlds — Smuggler's Run (7) by questccg | |
Single Item Shipping at The Game Crafter (0) by The Game Crafter |
Protospiel Indy 2024 (May 24-26) (0) by The Game Crafter |
How to avoid being blocked at content creation (10) by questccg |
Protospiel Indy 2024 (0) by sirvalence |
In need of some IDEAS concerning a "Battle" System (15) by questccg |
How to avoid quarterbacking in an adventure game (7) by larienna | |
How complicated could math get? (23) by X3M |
Can we have gaming ads on this website (7) by questccg |
Dice Mitigation Challenge - Winner Announced! (0) by The Game Crafter |
Delving! - " That is when it hit me, it was starting to feel like other games" (3) by MarkJindra | |
Game Purchase Contract (0) by MarkJindra |
Blackboard Boogie Board: a bit of a REVIEW... (2) by questccg |
Thank you for answering!
On my user page to the left it is written that "No game journals created" (as is the same for your user page). This is not true. Is this a known feature of the site?
Best regards,
Erik