PDA

View Full Version : Change table vertical to horizontal



basketmen
Apr 13th, 2007, 08:39 PM
i have script that shown image in table, i want the table shown in horizontal not vertical
this is the entire script, and the table that influence is in the red i think below

any idea guys what i need to edit?






# Photo Album
# 1.1
#
# Displays a members photos
class user_photoplog_album extends z_module
{
# Set the maximum amount of images any users are allowed to display
var $max_images = 5;
function contents()
{
$content = $this->content;
$vbulletin = $this->_zoints->external->vbulletin;

# If limit hasnt been set or is over the admin set maximum, set it to the admin max
if(empty($content['max_pics']) OR $content['max_pics'] > $this->max_images)
{
$limit_sql = 'LIMIT ' . $this->max_images;
}
# Otherwise, let them set it
else
{
$limit_sql = 'LIMIT ' . $content['max_pics'];
}

# Get all photos the user has
$getphotos = $vbulletin->db->query_read("
SELECT * FROM " . TABLE_PREFIX . "photoplog_fileuploads
WHERE userid=" . $this->zuser . "
AND moderate=0
ORDER BY dateline DESC
" . $limit_sql . "
");
$html .= '<div class="' . $this->style['pmain1'] . '" style="padding: 0;">';

# Does the user have any photos?
if ($vbulletin->db->num_rows($getphotos))
{
# Display the top of the table
$html .= '
<table border="0" width="100%">
<tr>
<td width="100" overflow-x: scroll; overflow-y: hidden; align="center" class="phead">
Image
</td>';
# Display the details?
if(!$content['details'])
{
$html .= ' ';
}
$html .= ' </tr>';

# loop and display all that have been fetched from the DB
while($photo = $vbulletin->db->fetch_array($getphotos))
{
# Display image cell
$html .= '
<tr>
<td width="100" align="center" class="pmain2">
<a href="' . $this->_zoints->external->url() . 'imagehosting/image' . $photo['fileid'] . '.html" target="_blank"">
<img src="' . $this->_zoints->external->url() . 'imagehosting/images/' . $photo['userid'] . '/small/' . $photo['filename'] . '" />
</a>
</td>
';
# Display the image details?
if(!$content['details'])
{
$html .= ' ';
}
$html .= '</tr>';
}
$html .= '</table>
<p><a href="index.php?u=' . $this->zuser . '" target="_blank">View All Photos</a>
</p>

<div>
<p>';
}
# Nope, tell them they have none
else
{
$html .= 'You don\'t have any photos. <a href="upload.php" target="_blank">Upload photos now!</a>';
}
$vbulletin->db->free_result($getphotos);

$html .= '</p>
</div>';
return $html;
}

function update($content)
{
return $content;
}
function edit()
{
$content = $this->content;
if($content['max_pics'] AND $content['max_pics'] < $this->max_images)
{
$limit = htmlspecialchars($content['max_pics']);
}
else
{
$limit = $this->max_images;
}
$html .= '<div class="pmain1">';

# Disable description checkbox
$html .= 'Disable image details? ';
$html .= '<input type="checkbox" name="mod[content][details]" ' . ($content['details'] ? 'checked="checked"': '') . ' /> <br />';
# Max pictures textbox
$html .= 'Max pictures to display ';
$html .= '<input type="text" name="mod[content][max_pics]" value="' . $limit . '" size="5" /> ';
$html .= '<span style="font-size: 7pt; color: #848484;">(max ' . $this->max_images . ' allowed)</span> ';

$html .= '</div>';

return $html;
}
}

koyama
Apr 14th, 2007, 02:28 AM
i have script that shown image in table, i want the table shown in horizontal not vertical
You have to be more clear what you mean by this. A link would be preferable together with an explanation what is wrong with the current rendering.