Re: [Dave] Can’t figure out how to use and place images...
I still don’t get the images (thumbs) shown for more than one story, the one in top. I want to have one thumbnail for each story. What am I doing wrong? I would wish, there was a help file just about how it is possible to place images...
Also I don’t want a linebreak to be after the date. I want the date and the summary to be on the same line. It seemes to me, that each <?php echo ... ?> command results in a linebreak, that disturbs how I would have it to look.
Below is my code on the page, and the actual result of the code can be seen here: http://televarp.fo.space2u.com/index.php
<!-- STEP1: Load Record List (Paste this above other steps) -->
<?php
require_once "/home/d26454/public_html/lib/viewer_functions.php";
$tidindiOptions = array(); // NOTE: see online documentation for more details on these options
$tidindiOptions['tableName'] = 'tidindi'; // (REQUIRED) MySQL tablename to list record from. Example: 'article';
$tidindiOptions['titleField'] = 'title'; // (optional) MySQL fieldname used in viewer url for search engines. Example: 'title' would display: viewer.php/article_title_here-123
$tidindiOptions['viewerUrl'] = 'tidindiPage.php'; // (optional) URL of viewer page. Example: '/articles/view.php';
$tidindiOptions['perPage'] = ''; // (optional) The number of records to display per page. Example: '5'; Defaults to 10.
$tidindiOptions['orderBy'] = 'featured DESC, date DESC, title'; // (optional) Fieldnames to sort by. Example: 'field1, field2 DESC, field3';
$tidindiOptions['pageNum'] = ''; // (optional) Page number of results to display. Example: '1'; Defaults to ?page=# value, or 1 if undefined
$tidindiOptions['where'] = ''; // (ADVANCED) Additional MySQL WHERE conditions. Example: 'fieldname = "value"'
$tidindiOptions['useSeoUrls'] = ''; // (ADVANCED) Set this to '1' for search engine friendly urls: view.php/123 instead of view.php?123 (not supported on all web servers)
list($tidindiRecordList, $tidindiListDetails) = getListRows($tidindiOptions);
?>
<!-- /STEP1: Load Record List -->
<!-- STEP1: Load Record (Paste this above other step) -->
<?php
require_once "/home/d26454/public_html/lib/viewer_functions.php";
$tidindiOptions = array(); // NOTE: see online documentation for more details on these options
$tidindiOptions['tableName'] = 'tidindi'; // (REQUIRED) MySQL tablename to list record from. Example: "article";
$tidindiOptions['recordNum'] = ''; // (optional) Record number to display. Example: "1"; Defaults to number on end of url, then 1
$tidindiOptions['where'] = ''; // (ADVANCED) MySQL WHERE conditions to use INSTEAD of recordNum to look up record. Example: "fieldname = 'value'"
$tidindiOptions['orderBy'] = 'featured DESC, date DESC, title'; // (optional) Fieldnames to sort by. Example: 'field1, field2 DESC, field3';
$tidindiRecord = getRecord($tidindiOptions);
?>
<!-- /STEP1: Load Record -->
<!-- STEP2: Display Record List (Paste this where you want your records to be listed) -->
<!-- STEP3: Display Uploads from 'uploads' (Paste this where you want your uploads displayed) -->
<!-- Upload Program Fields : num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath -->
<!-- Upload Image Fields : isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight -->
<!-- Upload Info Fields : info1, info2, info3, info4, info5 -->
<?php if ($tidindiRecord): ?>
<?php foreach (getUploads($tidindiOptions['tableName'], 'uploads', $tidindiRecord['num']) as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" align="<?php echo (@$row++ % 2) ? "left" : "right"; ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>
<?php endif ?>
<?php endforeach ?>
<?php endif ?>
<!-- STEP3: /Display Uploads from 'uploads' --><?php foreach ($tidindiRecordList as $tidindiRecord): ?>
<a href="<?php echo $tidindiRecord['_link'] ?>"><h3><?php echo $tidindiRecord['title'] ?></h3></a>
<?php echo $tidindiRecord['summary'] ?>
<?php endforeach ?>
<!-- /STEP2: Display Record List -->