Author Topic: Random Image in user_loginform.html  (Read 5148 times)

0 Members and 1 Guest are viewing this topic.

Offline glitzer

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • over 7000 E-Cards
Random Image in user_loginform.html
« on: December 26, 2007, 04:27:47 PM »
Hi alle

ich möchte gerne in meiner user_loginform.html und user_logininfo.html die Random Images einbauen.
jedoch weiß ich nicht in welche php datei ich dann den code einfügen muß damit es dort funktioniert.
Kann mir hierzu bitte jemand helfen?

I want to use the random images in my user_loginform.html and user_logininfo.html!
In which php file i have to put in the random code to get it works?

this is my random code:
/------------------------------------
//------- Random Images --------------
//------------------------------------
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
       FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
       LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
       WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")
       ORDER BY RAND()
       LIMIT $num_new_images";
// end new
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);

if (!$num_rows)  {
 $random_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
//  $random_images .= $lang['no_new_images'];
 $random_images .= "</td></tr></table>";
}
else  {
 $random_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
 $count = 0;
 $bgcounter = 0;
 while ($image_row = $site_db->fetch_array($result)){
   if ($count == 0) {
     $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
     $random_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
   }
   $random_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

   show_image($image_row);
   $random_images .= $site_template->parse_template("thumbnail_bit");
   $random_images .= "\n</td>\n";
   $count++;
   if ($count == $config['image_cells']) {
     $random_images .= "</tr>\n";
     $count = 0;
   }
 } // end while

 if ($count > 0)  {
   $leftover = ($config['image_cells'] - $count);
   if ($leftover >= 1) {
     for ($f = 0; $f < $leftover; $f++) {
       $random_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
     }
     $random_images .= "</tr>\n";
   }
 }
 $random_images .= "</table>\n";
} // end else


$site_template->register_vars("random_images", $random_images);
unset($random_images);

//----- End Random Images---------


Thanks for help

glitzer

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.873
    • View Profile
Re: Random Image in user_loginform.html
« Reply #1 on: December 26, 2007, 04:59:49 PM »
Hallo,

könnte es eventuell in der /includes/constant.php sein  :?:
Schaue es Dir mal an

nobby


edit
sorry da habe ich mich verguckt
edit ende
« Last Edit: December 26, 2007, 07:35:29 PM by nobby »

Offline Acidgod

  • Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Random Image in user_loginform.html
« Reply #2 on: December 26, 2007, 05:36:44 PM »

Offline glitzer

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • over 7000 E-Cards
Re: Random Image in user_loginform.html
« Reply #3 on: December 26, 2007, 05:44:10 PM »
Hallo!
danke für eure schnelle antwort
In den Constant passt der code nicht wirklich

Bezüglich einbau über extern Random will ich deshalb nicht machen, da es ja eh in der gallerie verwendet wird.

ist es nicht möglich den code zu verwenden wie für die Home.html?

das wäre fein
lg
glitzer

Offline Acidgod

  • Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Random Image in user_loginform.html
« Reply #4 on: December 26, 2007, 05:52:43 PM »
Ich habe keine Ahnung wie viel Du schon am Code geändert hast, aber ich persönlich finde die externe Lösung besser weil man so einfacher auf eine neues Version umschwenken kann...

Haltet euch bitte immer vor den Augen das auch die aktuelle Version vielleicht ein Sicherheitsloch hat und dann ist das geschreie groß wenn man ein uUpdate machen muss und alle Anpassungen hin sind.

Und ob Du den Code jetzt in einen vorhandenen Script einbaust oder die Lösung von Nicky nimmst ist nur ein minimaler Unterschied...