Author Topic: How to put "images_awaiting_validation" into the index page ?  (Read 7165 times)

0 Members and 1 Guest are viewing this topic.

Offline a4land

  • Newbie
  • *
  • Posts: 12
    • View Profile
How to put "images_awaiting_validation" into the index page ?
« on: November 12, 2005, 07:10:35 AM »
I want to know how many awaiting validation images are there in my album but without login in ADMIN CONTROL PANEL

I tried to put this code into ../album/index.php :
right before
Code: [Select]
include(ROOT_PATH.'includes/page_footer.php');I put this code :
Code: [Select]
//2
 
  $sql = "SELECT COUNT(*) as temp_images
          FROM ".IMAGES_TEMP_TABLE;
  $row = $site_db->query_firstrow($sql);

  $awaiting_validation = preg_replace("/".$site_template->start."num_images".$site_template->end."/siU", $row['temp_images'], $lang['images_awaiting_validation']);
  $awaiting_validation = sprintf("<a href=\"".$site_sess->url("validateimages.php?action=validateimages")."\">%s</a>", $awaiting_validation);
  echo "<center><td width=\"16%\"><b>".$lang['images']."</b></td><td width=\"16%\">".$total_images." / ".$awaiting_validation."</td>\n";
  $size = 0;
  echo "<center><td width=\"16%\"><b>".$lang['thumb_directory']."</b></td><td width=\"16%\">"."</td>\n";
  echo "</tr>";

But the result is : it only appeared on the bottom of index.php page . I want to show it somewhere else in the index page but I can't

Could someone show me how to do this , I mean , put this line : "8 images awaiting validation" into the INDEX page .
Thanks alot !!

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How to put "images_awaiting_validation" into the index page ?
« Reply #1 on: November 12, 2005, 08:06:16 AM »
Code: [Select]
  $sql = "SELECT COUNT(*) as temp_images
          FROM ".IMAGES_TEMP_TABLE;
  $row = $site_db->query_firstrow($sql);

  $awaiting_validation = preg_replace("/".$site_template->start."num_images".$site_template->end."/siU", $row['temp_images'], $lang['images_awaiting_validation']);
  $site_template->register_vars(array(
    "awaiting_validation_url" => $site_sess->url(ROOT_PATH."admin/validateimages.php?action=validateimages"),
    "awaiting_validation" => $awaiting_validation,
    "lang_images" => $lang['images'],
    "total_images" => $total_images
  ));
and use {awaiting_validation_url}, {awaiting_validation}, {lang_images}, {total_images} tags in the template
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: How to put "images_awaiting_validation" into the index page ?
« Reply #2 on: November 12, 2005, 04:04:24 PM »
hhmm i have test this but it doesn´t work.

I have search for

Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------

in index.php and before i have put this in

Code: [Select]
$sql = "SELECT COUNT(*) as temp_images
          FROM ".IMAGES_TEMP_TABLE;
  $row = $site_db->query_firstrow($sql);

  $awaiting_validation = preg_replace("/".$site_template->start."num_images".$site_template->end."/siU", $row['temp_images'], $lang['images_awaiting_validation']);
  $site_template->register_vars(array(
    "awaiting_validation_url" => $site_sess->url(ROOT_PATH."admin/validateimages.php?action=validateimages"),
    "awaiting_validation" => $awaiting_validation,
    "lang_images" => $lang['images'],
    "total_images" => $total_images
  ));

but when i use the tags {awaiting_validation_url}, {awaiting_validation}, {lang_images}, {total_images} is only {total_images} what works....the other tags show nothing...
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline a4land

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: How to put "images_awaiting_validation" into the index page ?
« Reply #3 on: November 13, 2005, 07:42:49 PM »
I think you should add this line to /lang/(your language)/main.php

Code: [Select]
$lang['images_awaiting_validation'] = "<b>{num_images}</b> images awaiting validation";
(This line is already exist in /lang/(your language)/admin.php)

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: How to put "images_awaiting_validation" into the index page ?
« Reply #4 on: November 20, 2005, 08:59:46 PM »
Thanks for this Mod. Now it works fine...
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-