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.
PoA — Major shift back closer to FCE (8) by questccg | |
Black Friday Sale Ends Tonight (0) by The Game Crafter |
Board Game Blueprint - New Episode Every Wednesday (22) by The Game Crafter |
The Shadow Of The Nokizaru Update! (0) by Jacob |
Build your own [insert game genre here] (11) by questccg | |
Black Friday Sale at The Game Crafter (0) by The Game Crafter |
Power Creep, a Dungeon Pages adventure (0) by jasongreeno |
Premium Bullet & Premium Toxic Waste Board Game Pieces at The Game Crafter (0) by The Game Crafter |
What “Should” Be in an RPG Design Book (11) by lewpuls |
Blank Poker Card Sale - 3 Cents Each! (0) by The Game Crafter | |
Blank Playing Cards - Bridge 57mm x 89mm UK (1) by questccg |
Finally returned after all these years (1) by DyminoMonsters2004 |
State of the let-off Union - November 2024 (0) by let-off studios |
Shoppe: The Simulation of Guilds (1) by questccg |
The fine line between a game and a simulation (22) by X3M |
Only 24 hours left to bid on games for the Extra Life Charity Auction (0) by The Game Crafter |
Songs of Conquest is now 60% off plus an additional discount for... (5) by questccg |
Returned the reMarkable 2 and purchased the BOOX Go 10.3 (3) by questccg |
Happy Halloween 2024 (0) by questccg |
Epic Metal Monster Coins - Now on Kickstarter - Created by The Game Crafter (0) by The Game Crafter | |
DuelBotz: Sample New Card (12) by questccg |
2 levels for an unit (wargames) (6) by X3M |
Dragon Spark Playthrough (0) by The Game Crafter |
New Board Game Pieces - Premium Water Droplet & Premium Blood Droplet (0) by The Game Crafter |
Designer with an 'almost' ready product (18) 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