Anyone know how to fix this? Sounds like a system bug to me.
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
padding: 0px;
margin: 0px;
color: #FFFFFF;
}
a {
color: #6666CC;
text-decoration: none;
}
a:hover {
color: #6666FF;
}
table {
font-size: 12px;
width: 100%;
}
table td {
}
h1 {}
h2 {}
h3 {}
h4 {}
h5 {}
ul { margin: 2px; padding: 2px; list-style: decimal inside; text-align: left;}
li { margin-left: 2px; list-style: square inside;}
input.formButton {
}
.item {
color: #FFFFFF;
font-weight: normal;
}
.item a {
color: #6666CC;
text-decoration: none;
}
.item a:hover {
color: #6666FF;
}
.itemHead {
padding: 2px;
color: #FFFFFF;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
}
.itemHead a {
color: #6666CC;
text-decoration: none;
}
.itemHead a:hover {
color: #6666FF;
}
.itemInfo {
text-align: right;
padding: 3px;
color: #CCCCCC;
font-weight: normal;
font-size: 95%;
border-bottom: 1px dotted #666666;
}
.itemTitle a {
font-variant: small-caps;
background-color: transparent;
font-size: 120%;
color: #FFFFFF;
}
.itemPoster {font-size: 90%; font-style:italic; color: #CCCCCC;}
.itemPostDate {font-size: 90%; font-style:italic; color: #CCCCCC;}
.itemStats {font-size: 90%; font-style:italic; color: #CCCCCC;}
.itemBody {
font-size: 90%;
text-align: justify;
color: #FFFFFF;
}
.itemText {
margin-top: 5px;
margin-bottom: 5px;
line-height: 1.5em;
color: #ffffff;
font-weight: normal;
margin-right: 5px;
margin-left: 5px;
}
.itemText:first-letter {font-size: 133%; font-weight: bold;}
.itemFoot {
text-align: right;
padding: 2px 3px 3px;
border-top-width: 1px;
border-top-style: dotted;
border-top-color: #666666;
font-size: 95%;
}
.itemAdminLink {font-size: 90%;}
.itemPermaLink {font-size: 90%;}
th {
background-image: url(wtr.jpg);
padding-top: 2px;
padding-right: 5px;
padding-bottom: 2px;
padding-left: 5px;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #FFFFFF;
letter-spacing: .6pt;
}
td#headerbanner {}
td#headerbar {}
td#centercolumn {font-size: 12px;}
td#centercolumn th {
vertical-align: middle;
background-image: url(sideback2.png);
border: 1px solid #CCCCCC;
font-size: 12px;
font-weight: normal;
}
td#centerCcolumn {padding: 0px 3px 1px 3px;}
td#centerCcolumn legend.blockTitle {
padding: 1px;
color: #639ACE;
font-weight: bold;
margin-top: 0px;
margin-right: 0px;
margin-left: 0px;
background-color: #000099;
}
td#centerCcolumn div.blockContent {
padding: 1px;
margin-right: 0px;
margin-left: 0px;
margin-bottom: 2px;
line-height: 120%;
}
td#centerLcolumn {width: 50%; padding: 0px 3px 0px 0px;}
td#centerLcolumn legend.blockTitle {padding: 3px; color: #639ACE; font-weight: bold; margin-top: 0px;}
td#centerLcolumn div.blockContent {border-left: 1px solid #F8F7F1; border-right: 1px solid #F8F7F1; border-bottom: 1px solid #dddddd; padding: 3px; margin-left: 3px; margin-right: 2px; margin-bottom: 2px; line-height: 120%;}
td#centerRcolumn {width: 50%; padding: 0px 3px 0px 0px;}
td#centerRcolumn legend.blockTitle {padding: 3px; color: #639ACE; font-weight: bold; margin-top: 0px;}
td#centerRcolumn div.blockContent {border-left: 1px solid #F8F7F1; border-right: 1px solid #F8F7F1; border-bottom: 1px solid #dddddd; padding: 3px; margin-left: 2px; margin-right: 3px; margin-bottom: 2px; line-height: 120%;}
div#content {
text-align: left;
width: 100%;
}
tr#footerbar {}
td#mainmenu a {
color: #C49730;
text-decoration: none;
padding-top: 3px;
padding-bottom: 3px;
padding-left: 1px;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
td#mainmenu a:hover {
color: #FFFFFF;
border: 1px solid #666666;
background-color: #787FB5;
padding-top: 2px;
padding-bottom: 2px;
font-weight: bold;
}
td#mainmenu a.menuTop {
padding-left: 10px;
}
td#mainmenu a.menuMain {
padding-left: 10px;
}
td#mainmenu a.menuSub {
padding-left: 15px;
}
td#usermenu a {
color: #FFFFFF;
text-decoration: none;
padding-top: 3px;
padding-bottom: 3px;
padding-left: 11px;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
td#usermenu a:hover {
color: #FFFFFF;
padding-top: 2px;
padding-bottom: 2px;
padding-left: 10px;
background-color: #787FB5;
border: 1px solid #666666;
font-weight: bold;
}
td#usermenu a.menuTop {
}
td#usermenu a.highlight {
padding-top: 2px;
padding-bottom: 2px;
padding-left: 10px;
}
.outer {
background-color: #333333;
vertical-align: top;
text-align: left;
}
.head {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
padding: 2px 5px;
background-color: #828282;
letter-spacing: .6pt;
color: #FFFFFF;
}
.even {
padding: 3px;
background-image: url(newsmid2.gif);
vertical-align: top;
text-align: left;
color: #FFFFFF;
}
.odd {
padding: 3px;
background-image: url(newsmid.gif);
vertical-align: top;
text-align: left;
color: #FFFFFF;
}
.foot {
padding: 3px;
font-size: 80%;
background-image: url(wtr.jpg);
}
tr.even td {
background-color: #585858;
vertical-align: top;
text-align: left;
background-image: url(newsmid2.gif);
}
tr.odd td {
vertical-align: top;
text-align: left;
background-image: url(newsmid.gif);
}
div.errorMsg { background-color: #FFCCCC; text-align: center; border-top: 1px solid #DDDDFF; border-left: 1px solid #DDDDFF; border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; font-weight: bold; padding: 10px;}
div.confirmMsg { background-color: #DDFFDF; color: #136C99; text-align: center; border-top: 1px solid #DDDDFF; border-left: 1px solid #DDDDFF; border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; font-weight: bold; padding: 10px;}
div.resultMsg { background-color : #F8F7F1; color: #333333; text-align: center; border-top: 1px solid silver; border-left: 1px solid silver; font-weight: bold; border-right: 1px solid #666666; border-bottom: 1px solid #666666; padding: 10px;}
div.xoopsCode { background: #FFFFFF; border: 1px inset #000080; font-family: "Courier New",Courier,monospace; padding: 0px 6px 6px 6px;}
div.xoopsQuote { background: #FFFFFF; border: 1px inset #000080; font-family: "Courier New",Courier,monospace; padding: 0px 6px 6px 6px;}
.comTitle {
margin-bottom: 2px;
color: #FFFFFF;
}
.comText {padding: 2px;}
.comUserStat {font-size: 10px; color: #000099; font-weight:bold; border: 1px solid silver; background-color: #ffffff; margin: 2px; padding: 2px;}
.comUserStatCaption {font-weight: normal;}
.comUserStatus {margin-left: 2px; margin-top: 10px; color: #000099; font-weight:bold; font-size: 10px;}
.comUserRank {margin: 2px;}
.comUserRankText {font-size: 10px;font-weight:bold;}
.comUserRankImg {border: 0;}
.comUserName {
color: #FFFFFF;
}
.comUserImg {margin: 2px;}
.comDate {font-weight: normal; font-style: italic; font-size: smaller}
.comDateCaption {font-weight: bold; font-style: normal;}
.mainbody {
padding: 10px;
color: #FFFFFF;
}
.mainbody a {
padding: 10px;
color: #6666CC;
}
.mainbody a:hover {
padding: 10px;
color: #6666FF;
}
.btable {
}
.btableouter {
width: 770px;
}
.sidetable {
width: 100%;
margin: 0px;
border-right-width: 1px;
border-right-style: solid;
border-right-color: #333333;
}
.sidemid {
width: 100%;
padding: 5px;
}
.sidebot {
width: 100%;
padding: 0px;
}
.sidetop {
padding: 2px 0px 2px 10px;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #333333;
background-image: url(wtr.jpg);
border-left-width: 1px;
border-right-style: solid;
border-left-style: solid;
border-right-color: #000000;
border-right-width: 1px;
border-left-color: #333333;
letter-spacing: 0.8pt;
}
.newstable {
padding: 0px;
border: 1px solid #333333;
margin: 0px;
background-image: url(newsmid.gif);
color: #FFFFFF;
}
.newstop {
padding: 2px 3px 2px 10px;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FFFFFF;
font-weight: bold;
border-bottom: 1px solid #666666;
background-image: url(wtr.jpg);
letter-spacing: .6pt;
}
.newsmid {
padding: 3px 10px;
text-align: justify;
color: #FFFFFF;
}
.newsmid a {
padding: 3px 10px;
text-align: justify;
color: #FFFFFF;
}
.newslrtable {
padding: 0px;
}
.newstd {
}
.newstablemain {
border: 1px solid #333333;
}
.sidepanel {
height: 93px;
}
.srchinput {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
background-color: #333333;
border: 1px solid #666666;
padding: 1px;
color: #FFFFFF;
}
.tdfooter {
font-size: 10px;
}
.footertext {
font-size: 10px;
color: #FFFFFF;
}
.topnav {
font-size: 90%;
}
title {
}
.notifications {
margin: 0px;
padding: 0px;
width: 98%;
}
.comments {
padding: 0px;
width: 98%;
background-color: #666666;
}
input {
font-size: 11pt;
}
.srchbutton {
border: 0px none;
}
.sidetd {
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #666666;
}
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
<meta name="robots" content="<{$xoops_meta_robots}>" />
<meta name="Keywords" content="<{$xoops_meta_keywords}>" />
<meta name="Description" content="<{$xoops_meta_description}>" />
<meta name="rating" content="<{$xoops_meta_rating}>" />
<meta name="author" content="<{$xoops_meta_author}>" />
<meta name="copyright" content="<{$xoops_meta_copyright}>" />
<meta name="generator" content="XOOPS" />
<title><{$xoops_sitename}> - <{$xoops_pagetitle}></title>
<link href="<{$xoops_url}>/favicon.ico" rel="SHORTCUT ICON" />
<link rel="stylesheet" type="text/css" media="all" href="<{$xoops_url}>/xoops.css" />
<link rel="stylesheet" type="text/css" media="all" href="<{$xoops_themecss}>" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body bgcolor="#333366" alink="#6699FF" link="#FFFFFF" vlink="#CCCCCC" leftmargin="0" topmargin="0">
<{$xoops_module_header}>
<script type="text/javascript">
<!--
<{$xoops_js}>
//-->
</script>
<a name="top" id="top"></a>
<table width="777" height="100%" border="0" cellpadding="0" cellspacing="0" class="btableouter">
<tr>
<td width="766" valign="top" bgcolor="#000000"><table width="766" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000" class="btable">
<tr>
<td width="203" rowspan="2" valign="top" background="<{$xoops_imageurl}>left_bg.jpg"><img src="<{$xoops_imageurl}>logo.jpg" alt="Crucial" width="203" height="157" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"> <{foreach item=block from=$xoops_lblocks}> <{include
file="sev_ventti/theme_blockleft.html"}> <{/foreach}> </td>
</tr>
<tr>
<td valign="top"> <{foreach item=block from=$xoops_rblocks}> <{include
file="sev_ventti/theme_blockright.html"}> <{/foreach}> </td>
</tr>
</table></td>
<td width="560"><table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#000000">
<tr>
<td align="right" valign="middle"><{$xoops_banner}></td>
<td align="right" valign="middle"><form style="margin-bottom: 0px; margin-top: 0px;" action="<{$xoops_url}>/search.php" method="post">
<input class="srchinput" name="query" type="text" size="15" />
<input type="hidden" name="action" value="results" />
<input name="Submit" type="image" value="Search" src="<{$xoops_imageurl}>srchbut.gif" alt="Search" align="middle" width="50" height="22" />
</form></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="mainbody" valign="top" bgcolor="#000000" background="<{$xoops_imageurl}>bg.jpg"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="100%" valign="top">
<{$xoops_contents}>
<div align="center"><table border="0" cellspacing="0" cellpadding="3">
<tr>
<td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="245" height="145" title="Current Album">
<param name="movie" value="/home/media/album.swf" />
<param name="quality" value="high" />
<embed src="/home/media/album.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="245" height="145"></embed>
</object></td>
<td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="245" height="145" title="Specials">
<param name="movie" value="/home/media/specials.swf" />
<param name="quality" value="high" />
<embed src="/home/media/specials.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="245" height="145"></embed>
</object></td>
</tr>
</table></div></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"> <{if $xoops_showcblock == 1}> <{foreach item=block from=$xoops_ccblocks}> <table cellspacing="0" class="newstable">
<tbody>
<tr>
<td class="newstop"><{$block.title}></td>
</tr>
<tr>
<td class="newsmid"> <{$block.content}> </td>
</tr>
<tr> </tr>
</tbody>
</table>
<br /> <{/foreach}> </td>
</tr>
<tr>
<td width="49%" valign="top" class="newstd" > <{foreach item=block
from=$xoops_clblocks}> <table cellspacing="0" class="newstable">
<tbody>
<tr>
<td class="newstop"><{$block.title}></td>
</tr>
<tr>
<td class="newsmid"><{$block.content}> </td>
</tr>
<tr>
<td class="newsbot"></td>
</tr>
</tbody>
</table>
<br /> <{/foreach}></td>
<td width="2%" valign="top" > </td>
<td width="49%" valign="top" class="newstd"><{foreach item=block
from=$xoops_crblocks}> <table cellspacing="0" class="newstable">
<tbody>
<tr>
<td class="newstop"><{$block.title}></td>
</tr>
<tr>
<td class="newsmid"> <{$block.content}> </td>
</tr>
<tr>
<td class="newsbot"></td>
</tr>
</tbody>
</table>
<br /> <{/foreach}></td>
</tr>
</table>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="100%" valign="top"><{/if}></td>
</tr>
</table>
</td></tr>
<tr>
<td width="203" valign="top" background="<{$xoops_imageurl}>wtr.jpg"> </td>
<td height="20" align="center" valign="middle" background="<{$xoops_imageurl}>wtr.jpg" bgcolor="#000000" class="tdfooter"><a href="#top">[TOP]
</a>
<!-- start of my buttons
<table border="0" cellpadding="10" cellspacing="0">
<tr>
<td width="25%"> </td>
<td width="25%" align="center"><a href="http://www.scds.com.au/"><img src="http://www.scds.com.au/images/scdsani2.gif" alt="SCDS XOOPS Themes" border="0" /></a><br />
</td>
<td width="25%" align="center"><a href="https://xoops.org" target="_blank"><img src="http://www.scds.com.au/images/xoopsbut3.gif" alt="This site is powered by XOOPS" border="0" /></a></td>
<td width="25%" align="left"> </td>
</tr>
</table>
End of my buttons -->
<br />
</td>
</tr>
</table> </td>
<td width="11" background="<{$xoops_imageurl}>shadow.jpg"><img src="<{$xoops_imageurl}>shadow.jpg" width="11" height="35" /></td>
</tr>
<tr>
<td valign="top" class="tdfooter"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="<{$xoops_imageurl}>footer.jpg">
<tr>
<td width="204" height="20" bgcolor="#000000"> </td>
<td align="center" bgcolor="#000000" class="footertext"><{$xoops_footer}></td>
</tr>
</table></td>
<td background="<{$xoops_imageurl}>shadow.jpg"></td>
</tr>
</table>
</body>
</html>
<?
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <https://xoops.org/> //
// ------------------------------------------------------------------------ //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
// Original Author: Mithrandir //
/**
* ImageBlock class
*
* @package modules
* @subpackage Homepage
*/
class ImageBlock extends HomepageBlock {
function ImageBlock() {
$this->HomepageBlock();
$this->assignVar('template', 'hp_blocktype_image.html');
$this->assignVar('blocktypename', 'Image');
//One day cache time
$this->assignVar('bcachetime', 86400);
}
/**
* Builds a form for the block
*
*/
function buildForm() {
$myts =& MyTextSanitizer::getInstance();
include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
echo $this->showImages();
if (isset($_GET['imageid'])) {
$image = $this->getImage($_GET['imageid']);
}
else {
$image = array('image' => '');
}
$form = new XoopsThemeForm('', 'imageform', 'manage.php');
$image_input = new XoopsFormText(_HP_MA_IMAGE, 'image', 60, 255, $myts->htmlSpecialChars($image['image']));
$image_input->setExtra(" /><img align='middle' onmouseover='style.cursor="hand"' onclick='javascript:openWithSelfMain("".XOOPS_URL."/imagemanager.php?nocode=1&target=image","imgmanager",400,430);' src='".XOOPS_URL."/images/image.gif' alt='image' title='image'");
$form->addElement($image_input, true);
if (isset($image['fieldid'])) {
$form->addElement(new XoopsFormHidden('imageid', $image['fieldid']));
}
$form->addElement(new XoopsFormHidden('op', 'editblock'));
$form->addElement(new XoopsFormHidden('blockid', $this->getVar('blockid')));
$form->addElement(new XoopsFormButton('', 'submit', _HP_MA_SUBMIT, 'submit'));
$form->display();
if (isset($image['fieldid'])) {
$img = @imagecreatefromjpeg($image['image']);
if ($img) {
$img_height = imagesy($img) + 10;
ImageDestroy($img);
}
echo '<div>
<iframe src="'.$image['image'].'" width="99%" height="'.$img_height.'px" frameborder="0">
<a href="'.$image['image'].'">Image</a>
</iframe>
</div>';
}
}
/**
* Builds a homepageblock
*
* @return array
*/
function buildBlock() {
$block['image'] = $this->getRandomImage();
$img = @imagecreatefromjpeg($block['image']['image']);
if ($img) {
$block['img_height'] = imagesy($img) + 10;
ImageDestroy($img);
}
return $block;
}
/**
* Performs actions following buildForm submissal
*
*/
function updateBlock() {
$myts = MyTextSanitizer::getInstance();
if (isset($_POST['imageid']) && $_POST['imageid'] > 0) {
$sql = "UPDATE ".$this->table."
SET value='".$myts->addSlashes($_POST['image'])."',
weight=0,
updated=".time()."
WHERE blockid=".$this->getVar('blockid')." AND fieldid=".intval($_POST['imageid']);
}
else {
$sql = "INSERT INTO ".$this->table." (blockid, weight, value, updated) VALUES
(".$this->getVar('blockid').", 0, '".$myts->addSlashes($_POST['image'])."', ".time().")";
}
return $this->db->query($sql);
}
/** Deletes a single item
*
* @return bool
*/
function deleteItem() {
$id = intval($_REQUEST['id']);
$sql = "DELETE FROM ".$this->table." WHERE blockid=".$this->getVar('blockid')." AND fieldid=".$id;
if ($this->db->queryF($sql)) {
return true;
}
return false;
}
/**
/* Show items already present in the block
*
* @return string
*/
function showImages() {
$images = $this->getImages();
$ret = "<table>";
$ret .= "<tr class='head'><td>"._HP_MA_IMAGE."</td><td>"._HP_MA_EDIT."</td><td>"._HP_MA_DELETE."</td></tr>";
foreach ($images as $imageid => $row) {
$page = isset($page) && $page == "odd" ? "even" : "odd";
$ret .= "<tr class='".$page."'>";
$ret .= "<td>".$row['image']."</td>";
$ret .= "<td><a href='manage.php?op=editblock&blockid=".$this->getVar('blockid')."&imageid=".$imageid."'>"._HP_MA_EDIT."</a></td>";
$ret .= "<td><a href='manage.php?op=deleteitem&b=".$this->getVar('blockid')."&id=".$imageid."'>"._HP_MA_DELETE."</a></td>";
$ret .= "</tr>";
}
$ret .= "</table>";
return $ret;
}
/**
* retrieve item from database
*
* @param int $id imageid
*
* @return array
*/
function getImage($id) {
$id = intval($id);
$sql = "SELECT * FROM ".$this->table." WHERE fieldid=".$id;
$result = $this->db->query($sql);
$row = $this->db->fetchArray($result);
$row['image'] = $row['value'];
return $row;
}
/**
* Retrieves all items in a block
*
* @return array
*/
function getImages() {
$ret = array();
$myts =& MyTextSanitizer::getInstance();
$sql = "SELECT * FROM ".$this->table." WHERE blockid=".$this->getVar('blockid')." ORDER BY updated DESC";
$result = $this->db->query($sql);
while ($row = $this->db->fetchArray($result)) {
$ret[$row['fieldid']] = array('imageid' => $row['fieldid'],
'image' => $myts->htmlSpecialChars($row['value']),
'weight' => $row['weight']);
}
return $ret;
}
/**
* retrieve random item from database
*
* @return array
*/
function getRandomImage() {
$myts =& MyTextSanitizer::getInstance();
$sel_time = time() - (86400 * 2);
$sql = "SELECT * FROM ".$this->table." WHERE blockid=".$this->getVar('blockid')." AND updated > ".$sel_time;
$result = $this->db->query($sql);
$images = array();
while ($row = $this->db->fetchArray($result)) {
$images[] = $row;
}
$num_images = count($images);
if ($num_images == 0) {
$sql = "SELECT * FROM ".$this->table." WHERE blockid=".$this->getVar('blockid')." LIMIT 0,1";
$result = $this->db->query($sql);
$images[] = $this->db->fetchArray($result);
}
$random_number = rand(0, $num_images-1);
$row = $images[$random_number];
//$row['image'] = $myts->displayTarea($row['value']);
$row['image'] = $row['value'];
$sql = "UPDATE ".$this->table." SET updated=".time()." WHERE fieldid=".$row['fieldid'];
$this->db->queryF($sql);
return $row;
}
}
?>
if ( $xoopsUser ) {
$userdata['realname'] = $foundusers[$j]->getVar("name") ? "<A HREF='/userinfo.php?uid=".$foundusers[$j]->getVar("uid")."'>".$foundusers[$j]->getVar("name")."" : "</A>";
} else {
$userdata['realname'] = $foundusers[$j]->getVar("name") ? $foundusers[$j]->getVar("name") : " ";
}