Home aeyStudio
Welcome Guest · Registration
Resources
Download Seportal
Demo Site
SePortal Sites

Users
Username:

Password:

Log me on automatically next visit?


» Forgot password
» Registration

Topics
Home
Seportal (5)
News (3)

Who is Online
Currently active users: 4
There are currently 0 registered user(s) (0 among them invisible) and 4 guest(s) online.

Random Image
Anketler/Polls

Anketler/Polls
Comments: 0
zebaniz

Powered By
Powered by SePortal

Rate SePortal at
Listed at Hot Scripts in PHP

Scripts.com


ScriptSearch.com



Add Reply New Topic

> "New Images" on first page - How to show "new images" block on P.1?
 
 
haraldrose
Posted: 09.12.2008 - 04:49
Quote


Member
*

Group: Üyeler
Total posts: 15
User No: 73
Join Date: 04.03.2008 14:38



 
On the gallery page is a block called "new images". I would like to show the same block on TOP of page 1, as a centerblock. Where will I find the ingredients?
Offline haraldrose
Top
 
zebaniz
Posted: 14.12.2008 - 19:11
Quote


Administrator
Group Icon

Group: Admin
Total posts: 306
User No: 1
Join Date: 01.01.2007 00:00



 
The gallery index page contains 3 photos that added. You can change this from Admin/Settings Image table cells
or you can create a new static page by; admin/staticpages.php?action=addstpage
Offline zebaniz
Top
 
haraldrose
Posted: 20.12.2008 - 07:56
Quote


Member
*

Group: Üyeler
Total posts: 15
User No: 73
Join Date: 04.03.2008 14:38



 
I think you misunderstood. I want the "new images" to show up on top of the "index.php" page.

happy.gif
Offline haraldrose
Top
 
zebaniz
Posted: 22.12.2008 - 12:29
Quote


Administrator
Group Icon

Group: Admin
Total posts: 306
User No: 1
Join Date: 01.01.2007 00:00



 
Sorry happy.gif
1- Open includes/lib-custom.php
find:
PHP

?>

add before:
PHP

function NewImage_Block($img_num='10'){
    global 
$site_db$site_sess$lang;
 
    
$html startBlock"New Images");

    
$sql "SELECT image_id, image_name
            FROM "
.GAL_IMAGES_TABLE."
            WHERE image_active = 1 ORDER BY image_id DESC LIMIT "
.$img_num;
    
$result $site_db->query($sql);
    
$num_rows $site_db->get_numrows($result);

    if (!
$num_rows) {
        
$html .= $lang['no_newimages']."<br><br>";
    }
    else { 
      while (
$row $site_db->fetch_array($result)) {
                
$html .= "<a title='".$row['image_name']."' href='".$site_sess->url(ROOT_PATH."gallery_image.php?".URL_IMAGE_ID."=".$row['image_id'])."'>".$row['image_name']."</a><br>";

      }  
      
$html .= '<br>';
    }

    
$html .= endBlock();
    return 
$html;
}


2- Open includes/page_header.php
find:
PHP

?>

and add before:
PHP

$NewImage_Block 
=  NewImage_Block('10');
$site_template->register_vars("NewImage_Block",$NewImage_Block );

Note: This is only for 10 new images.
You can change '10' (e.g. NewImage_Block('15'); NewImage_Block('20');)
3- Open templates/default/home.html
find:
CODE

{newcontent}

and add before:
CODE

{NewImage_Block}

Offline zebaniz
Top
 
haraldrose
Posted: 23.12.2008 - 10:16
Quote


Member
*

Group: Üyeler
Total posts: 15
User No: 73
Join Date: 04.03.2008 14:38



 
Thank you VERY much for your effort.

However, I get a >unexpected ""< error for this line:
$html .= "<a title="".$row['image_name']."" href="".$site_sess->url(ROOT_PATH."gallery_image.php?".URL_IMAGE_ID."=".$row['image_id'])."">".$row['image_name']."</a><br>";
Offline haraldrose
Top
 
zebaniz
Posted: 24.12.2008 - 10:26
Quote


Administrator
Group Icon

Group: Admin
Total posts: 306
User No: 1
Join Date: 01.01.2007 00:00



 
Try again please (process 1)
Offline zebaniz
Top

Add Reply New Topic



Contribute | Forums | Gallery | Calendar | Links | Downloads | Members | Search | Guestbook | Article Directory

Powered by SePortal 2.5
Copyright © 2007-2012 SePortal.org