I wonder if there is a quick fix to an existing page, so user doesn't have to reduce size of an image manually before uploading. Big images totally wrecks the page, and I would really like to just put in some code to set the max size. I don't really know much about php, but promised a friend to try to find a simple solution.
Code is like this today:
- Code: Select all
<?
/* Display all news */
// Retrieve all published 'news' articles. */
$articles = article::search("news", "", 99, TRUE); // category, keyword, limit, published
// Print each article.
foreach($articles AS $article_id) {
$art = new article($article_id);
// Get all pictures
$media_ids = $art->get_media();
$cover = new media($media_ids[0]);
// Get all links
$links_ids = $art->get_links(); ?>
<tr><td>
<h2><?= $art->get("heading"); ?></h2>
<img class="inlineright" src="<?= URL_UPLOAD . $cover->get("file_name"); ?>" alt="" title="" align="right">
<?= $art->get("text"); ?>
<br />
<? foreach($links_ids AS $link_id) {
$link = new link($link_id); ?>
<br /><a target="<?=$link->get("target");?>" href="<?=$link->get("url");?>" title="<?=$link->get("description");?>"><?=$link->get("text");?></a>
<? } ?>
</td></tr>
EDIT: Sorry, I mean of course MAX WIDTH!

