MemHT Portal is a Free PHP CMS and Blog
It permit the creation and the management online of websites with few and easy steps.
It's completely customizable, expandable and suitable for all needs.
A2Hosting
Moderators: Moderators
Forum RSS feedReply
Generate thumbnail for article
AuthorText
Wloczykij
Junior Member

Posts: 19
Contributes: 20

Gender: _MALE_
Online: No

Languages: Polish
Version: 4.0.1
Country: POLAND
Date: 05/05/2009 18:47
Generate thumbnail for article
#post19824
Hello.

eioban.com. I would like to have articles thumbnail image to the left of the page. It could be generated at random from any picture inserted in the article, or a special field in the editor on the thumbnail. Then put the script in a loop.
I have overwhelming problems with PHP.

If anyone is willing please.
PS: I have PHP and MySQL book, third edition, but it is quite difficult.
<?php
?>
Delete Edit Quote
 
msarab
Junior Member
msarab

Posts: 44
Contributes: 46

Gender: _MALE_
Online: No

Version: 4.1
Languages: Arabic,English,
Date: 06/05/2009 07:23
Re: Generate thumbnail for article
#post19840
hi dear,
you can use this class it's easy and nice
so i hope it will interest you
MS ALL
Delete Edit Quote
 
msarab
Junior Member
msarab

Posts: 44
Contributes: 46

Gender: _MALE_
Online: No

Version: 4.1
Languages: Arabic,English,
Date: 06/05/2009 07:30
Re: Generate thumbnail for article
#post19841
or use this with complete example Smile
MS ALL
Delete Edit Quote
 
Wloczykij
Junior Member

Posts: 19
Contributes: 20

Gender: _MALE_
Online: No

Languages: Polish
Version: 4.0.1
Country: POLAND
Date: 06/05/2009 11:41
Re: Generate thumbnail for article
#post19844
quote
msarab:
or use this with complete example Smile



I do not know how and where to put it.
Set in the files and upload.

Loop articles.
pages/articles/index.php

code
<?php

if (!defined("_LOAD_PAGE_")) {
die("<table style='padding: 2px; border: 1px solid #999; background-color: #EEE; font-family: Verdana; font-size: 10px;' align='center'><tr><td><b>Error:</b> This file cannot be opened directly!</td></tr></table>");
}

//------
//whr: 1
//------

$op = (isset($_GET['op'])) ? inCode($_GET['op']) : "";

if (isset($_GET['id'])) { $id = intval($_GET['id']); $title = ""; } else {
$title = (isset($_GET['title'])) ? mem_urldecode(inCode($_GET['title'])) : "";
$id = "";
}
if (isset($_GET['aid'])) { $aid = intval($_GET['aid']); } else { $aid = 0; }
if (isset($_GET['ok'])) { $ok = inCode($_GET['ok']); } else { $ok = false; }
if (isset($_GET['rank'])) { $rank = inCode($_GET['rank']); } else { $rank = ""; }

if (isset($_GET['pg'])) { $pg = intval($_GET['pg']); } else { $pg = 1; }
$ofsppg = 60; //Items per page
$ofsbgn = ($pg*$ofsppg)-$ofsppg;

function artList() {
global $dblink,$siteConfig;

openTable();
echo '<dl id="menu0">';
if ($result = $dblink->get_list("SELECT * FROM memht_argomenti ORDER BY nome")) {
foreach ($result as $row) {
$ida = intval($row['id']);
$inome = outCode($row['nome']);

if ($dblink->get_num("SELECT id FROM memht_articoli WHERE argomento=$ida AND enabled=1")>0) {
echo "<dt><b>$inome</b></a></dt>\n";
$result = $dblink->get_list("SELECT *,DATE_FORMAT(data, '".$siteConfig['timestamp']."') as data FROM memht_articoli WHERE argomento=$ida AND enabled=1 ORDER BY id DESC LIMIT 100");
foreach ($result as $row) {
$id = intval($row['id']);
$nome = outCode($row['nome']);
$autore = outCode($row['autore']);
$data = $row['data'];
$hits = intval($row['hits']);
                                      /* ******************* EDYCJA TEMATÓW  ********************/
echo "<dd>Wyświetlenia: $hits". " autor: $autore<br />". "<a href='http://www.memht.com/index.php?page=articles&op=readArticle&id=$id&title=".mem_urlencode($nome)."' title='$nome'>$nome</a></dd>\n";
}
/* echo "<dd><a href='http://www.memht.com/index.php?page=articles&op=arg&id=$ida&title=".mem_urlencode($inome)."' title='$inome'><i>"._COMPLETE_LIST_."</i></a></dd>\n";  */

}
}
} else {
echo "<dd><b>"._NOARTICLES_."</b><dd>\n";
}
echo '</dl>
<script type="text/javascript">
// <![CDATA[
new Menu('
menu0');
// ]]>
</script>'
;
closeTable();

}
<?php
?>
Delete Edit Quote
 
Reply
Tags Cloud
Twitter updates...
Help MemHT Portal
Navigator
Users Block
Hi Guest
IP: 38.107.179.234

Username
Password
MemHT Wiki
Language
MemHT Portal is a free software released under the GNU/GPL License by Miltenovik Manojlo