|
|
|
THEMA: YASB Archive!?
|
KLM
(Besucher)
|
|
YASB Archive!? vor 2 Monaten, 1 Woche
|
|
|
Hi!
I love your module! Simple and effective. Though I'd prefere not to delete the old shouts, but list them all in an shout archive page.
Can you help me with a mysql query and a php code to list at least last let's say 50 shouts?
Thanks and kind regards!
|
|
|
|
Gespeichert
|
|
|
|
KLM
(Besucher)
|
|
Aw: YASB Archive!? vor 1 Monat, 3 Wochen
|
|
Okay, here's the code - used it with Jumi Component and phpBB profiles:
| Code: |
<?php
// YaSB - Yet another ShoutBox Archive Page
//
// Author: Klemen Geršak (klm.tanatos@gmail.com)
// Version: 1.1.2
//
if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; };
$start_from = ($page-1) * 20;
$sql = "SELECT * FROM `joo_yasb` ORDER BY `id` DESC LIMIT $start_from, 20";
$rs_result = mysql_query ($sql);
?>
<table width="100%" bgcolor="#f9f9f6" cellpadding="5">
<tr height="20"><td><b>Nick</b></td><td><b>Txt</b></td><td width="150"><b>@</b></td></tr>
<?php
while ($row = mysql_fetch_assoc($rs_result)) {
?>
<tr>
<td>
<? echo "<a href=forum/memberlist.php?mode=viewprofile&u=".$row['uid'].">".$row['name']; ?></td>
<td><? echo $row["text"]; ?></td>
<td><? echo $row["time"]; ?></td>
</tr>
<?php
};
?>
</table>
<?php
$sql = "SELECT COUNT(name) FROM joo_yasb";
$rs_result = mysql_query($sql);
$row = mysql_fetch_row($rs_result);
$total_records = $row[0];
$total_pages = ceil($total_records / 20);
for ($i=1; $i<=$total_pages; $i++) {
if($page==$i){
echo "<b>Stran $i </b>";
}else{
echo "<a href=index.php?option=com_jumi&fileid=4&Itemid=239&page=".$i.">Stran ".$i." </a> ";
}
};
?>
|
|
|
|
|
Gespeichert
|
|
|
|
Manos
(Besucher)
|
|
Aw: YASB Archive!? vor 1 Monat
|
|
Hi and thanks SO much for the amazing extension.
I have entered the code in Jumi, but I only get the header. No records returned.
The URL is: www.mysims.gr/index.php?option=com_jumi&...temid=92&lang=en
Please advise.
Thank you,
Manos
KLM schrieb:
Okay, here's the code - used it with Jumi Component and phpBB profiles:
| Code: |
<?php
// YaSB - Yet another ShoutBox Archive Page
//
// Author: Klemen Geršak (klm.tanatos@gmail.com)
// Version: 1.1.2
//
if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; };
$start_from = ($page-1) * 20;
$sql = "SELECT * FROM `joo_yasb` ORDER BY `id` DESC LIMIT $start_from, 20";
$rs_result = mysql_query ($sql);
?>
<table width="100%" bgcolor="#f9f9f6" cellpadding="5">
<tr height="20"><td><b>Nick</b></td><td><b>Txt</b></td><td width="150"><b>@</b></td></tr>
<?php
while ($row = mysql_fetch_assoc($rs_result)) {
?>
<tr>
<td>
<? echo "<a href=forum/memberlist.php?mode=viewprofile&u=".$row['uid'].">".$row['name']; ?></td>
<td><? echo $row["text"]; ?></td>
<td><? echo $row["time"]; ?></td>
</tr>
<?php
};
?>
</table>
<?php
$sql = "SELECT COUNT(name) FROM joo_yasb";
$rs_result = mysql_query($sql);
$row = mysql_fetch_row($rs_result);
$total_records = $row[0];
$total_pages = ceil($total_records / 20);
for ($i=1; $i<=$total_pages; $i++) {
if($page==$i){
echo "<b>Stran $i </b>";
}else{
echo "<a href=index.php?option=com_jumi&fileid=4&Itemid=239&page=".$i.">Stran ".$i." </a> ";
}
};
?>
|
|
|
|
|
Gespeichert
|
|
|
|
Manos
(Besucher)
|
|
Aw: YASB Archive!? vor 1 Monat
|
|
|
OK, I have added the following lines of code right after $rs_result = mysql_query ($sql);
if (!$rs_result) {
echo "Could not successfully run query ($sql) from DB: " . mysql_error();
exit;
}
if (mysql_num_rows($rs_result) == 0) {
echo "No rows found, nothing to print so am exiting";
exit;
}
When I run it I get the error: Could not successfully run query (SELECT * FROM `jos_yasb` ORDER BY `id` DESC LIMIT 0, 20) from DB: Access denied for user 'mysimsgr'@'localhost' (using password: NO)
So it must be a problem of Jumi.
Since you have tryed the code it Jumi, did you face the problem and if yes, how did you resolve it?
Thanks in advance,
Kind regards,
Manos
|
|
|
|
Gespeichert
|
|
|
|
|
|
|
|
|
|