Author Topic: zwei spalten neue Bilder auf home möglich?  (Read 75896 times)

0 Members and 1 Guest are viewing this topic.

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: zwei spalten neue Bilder auf home möglich?
« Reply #30 on: July 03, 2009, 08:18:52 PM »
hi andi...

leider immer noch fehlerbehaftet..

Code: [Select]
DB Error: Bad SQL Query: 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,i.image_DateTimeOriginal c.comment_date > '1245781074' AND c.image_id = '396', c.cat_name, u.username FROM (4images_images i, 4images_categories c) LEFT JOIN phpbb_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (0)AND i.cat_id IN (Array) ORDER BY i.image_date DESC LIMIT 3
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.comment_date > '1245781074' AND c.image_id = '396', c.cat_name, u.username ' at line 1

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/web45/html/includes/db_mysql.php on line 116

auf welche zeilen muss ich denn achten??
gruss, bergblume

Rembrandt

  • Guest
Re: zwei spalten neue Bilder auf home möglich?
« Reply #31 on: July 03, 2009, 08:30:22 PM »
da stimmt doch was nicht poste doch mal deine index.php vor diesen ganzen einbau, als sie noch funktioniert hat

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: zwei spalten neue Bilder auf home möglich?
« Reply #32 on: July 03, 2009, 08:37:23 PM »
anbei die funktionierende index.php

Rembrandt

  • Guest
Re: zwei spalten neue Bilder auf home möglich?
« Reply #33 on: July 03, 2009, 09:13:51 PM »
so..

wenn das nicht funktioniert kann ich dir im moment nicht weiterhelfen, da deinen "new_images" nicht orignal ist.
aber du kannst es dir ja mal selber ansehen.

mfg Andi

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: zwei spalten neue Bilder auf home möglich?
« Reply #34 on: July 03, 2009, 11:34:07 PM »
servus andi... vielen dank für deine unterstützung... leider immer noch keine besserung....
ich habe halt schon ziemlich viele andere mods in meiner index.php eingebaut... u.a. SEO friendly URLs, News-MOD, php-Bridge...
ich denke dass da irgendwo das problem liegt...
gruss. bergblume

(p.s. ich will diese funktion nicht für meine tourendatenbank-seite sondern für ein anderes projekt nutzen)

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: zwei spalten neue Bilder auf home möglich?
« Reply #35 on: July 07, 2009, 12:40:30 PM »
servus andi,

ich habe übrigens mittlerweile herausgefunden, warum es bei mir zu fehlermeldungen kam....

der code kollidiiert mit dem nachfolgenden code vom [MOD] latest news and archive:

Code: [Select]
//----------------------------------------------------
// Latest and Archive News Mod                      --
//                                --
// User configurable variables                      --
// You must change the first 4 variables to meet    --
// your requirements:     (see notes below)        --
// $display_by_count    --
// $latest_news_day    --
// $show_news_articles    --
// $news_image        --
//----------------------------------------------------
  $display_by_count = "0";      // values 0 or 1
   // Change this to 0 if display by days posted or 1 to display fixed number of news articles as Latest
  $latest_news_days = "10";     // Number of days news displays at Latest
   // Change This to the number of days news shows as Latest
  $show_news_articles = "3";    // Number of news articles to show
   // Change This to fixed number of articles to display for latest news
  $news_image = "396"; // Change This to your Latest news image id

  $new_news = (time() - 60 * 60 * 24 * $latest_news_days);
//----------------------------------------------------

if ($newstype == "latestnewsall"){
    $news_type = "latestnewsall";
    }
else {
    $news_type = "latestnews";
    }

//-----------------------------------------------------
//---Show Latest News   -------------------------------
//-----------------------------------------------------
  $additional_sql = "";

  if ($news_type == "latestnews") {

if ($display_by_count) {
$additional_sql .= "  c.image_id = '".$news_image."'";
$additional_sql_2 .= " LIMIT ".$show_news_articles;
}
else {
$additional_sql .= " c.comment_date > '".$new_news."' AND c.image_id = '".$news_image."'";
$additional_sql_2 .= "";
}
  }

  else {
    $additional_sql .= " c.image_id = '".$news_image."'";
    $clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>&nbsp;/&nbsp;Archived News";
  }


  $sql = "SELECT c.comment_headline, c.comment_text, c.comment_date, c.image_id
            FROM ".COMMENTS_TABLE." c
            WHERE ".$additional_sql."
            ORDER BY c.comment_date DESC" .$additional_sql_2 ;

  $result = $site_db->query($sql);
  $num_rows = $site_db->get_numrows($result);
  $news_comment_row = array();


  while ($row = $site_db->fetch_array($result)) {
    $news_comment_row[] = $row;
  }

  $site_db->free_result($result);
  
// Paging stuff
  if ($newstype == "latestnewsall") {
  
include(ROOT_PATH.'includes/paging.php');
$perpage = $show_news_articles;
$link_arg = $site_sess->url(ROOT_PATH."index.php?newstype=latestnewsall");
$getpaging = new Paging($page, $perpage, $num_rows, $link_arg);
$offset = $getpaging->get_offset();

$site_template->register_vars(array(
 "paging" => $getpaging->get_paging(),
 "paging_stats" => $getpaging->get_paging_stats()
));

$sql = "SELECT c.comment_headline, c.comment_text, c.comment_date, c.image_id
            FROM ".COMMENTS_TABLE." c
            WHERE ".$additional_sql."
            ORDER BY c.comment_date DESC" .$additional_sql_2."
            LIMIT $offset, $perpage";

   $result = $site_db->query($sql);
   $num_rows = $site_db->get_numrows($result);
   $news_comment_row = array();
  
   while ($row = $site_db->fetch_array($result)) {
     $news_comment_row[] = $row;
   }
  }
//

  if (!$num_rows) {
      $news_comments = "&nbsp;&nbsp;&nbsp;<b>No New News to report within the last ".$latest_news_days." days.</b>";
  }
  else {
      $news_comments = "";
      $bgcounter = 0;

    for ($i = 0; $i < $num_rows; $i++) {
        $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;

        $site_template->register_vars(array(
            "news_comment_headline" => format_text($news_comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
            "news_comment_text" => format_text($news_comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
            "news_comment_date" => format_date($config['date_format']." ".$config['time_format'], $news_comment_row[$i]['comment_date']),
            "row_bg_number" => $row_bg_number));

        $news_comments .= $site_template->parse_template("news_comment_bit");
    }

  }
  $site_template->register_vars("news_comments", $news_comments);
  unset($news_comments);

wenn ich diesen code auskommentiere, funktioniert auch dein code.... wo ist hier das problem der beiden mods miteinander? (auch wenn das von meiner Seite nicht mehr gelöst werden muss...)
gruss,
bergblume

Nochmals ein dickes DANKE an dich Andi für die Lösung dieser Aufgabenstellung - damit ergeben sich nun hervorragende Möglichkeiten zur indiviuellen Gestaltung der Startseite!!!
« Last Edit: July 07, 2009, 06:53:34 PM by bergblume »

Offline neverkas

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
    • FullPosteo
Re: zwei spalten neue Bilder auf home möglich?
« Reply #36 on: July 15, 2009, 04:32:26 AM »
Hi!
...
Gibt es da eine elegante Lösung?

1.) Suche in der admin/settings.php:

show_admin_header
();

und füge davor ein:

//--------------------------------- Start cat select pic ---------------------------------
function show_cat_rand_pic($setting_name$setting_value) {
  global 
$cat_rand_pic;
  foreach (
$cat_rand_pic as $key => $val)
 {echo 
"<input type=\"text\" name=\"setting_item[".$setting_name."]\" value=\"$key\"";
    if (
$setting_value == $key) {
      echo 
" checked=\"checked\"";
    }
    echo 
"> ".$val."<br />";
  }
}
//--------------------------------- End cat select pic ---------------------------------

Suche in der admin/settings.php:

show_table_separator
($setting_group[3], 2"setting_group_3");

und füge davor ein:

 
//--------------------------------- Start cat select pic ---------------------------------
	
show_setting_row("cat_rand_pic");
//--------------------------------- End cat select pic ---------------------------------


2.) suche in lang/deutsch/admin.php

$setting_group
[3]="Bild Einstellungen";

und füge davor ein:

//--------------------------------- Start cat select pic ---------------------------------
$setting['cat_rand_pic'] = "Kategorie Bilder Anzeigen:<br /><span class=\"smalltext\">ID Nummern mit , trennen.</span>";
//--------------------------------- End cat select pic ---------------------------------


3.) suche in der index.php

//--- Print Out ---------------------------------------

und füge davor ein:

//--------------------------------- Start cat select pic ---------------------------------
$sql "SELECT  setting_value as cat_rand_pic FROM ".SETTINGS_TABLE." WHERE setting_name = 'cat_rand_pic'";
    
$result $site_db->query($sql); $row mysql_fetch_object($result);
      
$cat_in$row->cat_rand_pic;
//----------------------------------------------------------  Start Total Hits  - Cat Select  -------------------------------------------------------------------------
	
	
	

  
$cat_total str_replace(",","','",$cat_in);

  
$sql "SELECT SUM(image_hits) AS sum
             FROM "
.IMAGES_TABLE."
             WHERE cat_id IN ('
$cat_total')";
  
$row $site_db->query_firstrow($sql);
	
$sum = (isset($row['sum'])) ? $row['sum'] : 0;
  
$total_hits_cat_select "".$lang['total_hits_cat_select']."<B> ".$row['sum']."</B>\n";
  
$site_template->register_vars("total_hits_cat_select"$total_hits_cat_select);
//------------------------------------------------------------  End Total Hits  - Cat Select  --------------------------------------------------
   
$num_new_images $config['image_cells'];

$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 NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").")AND i.cat_id IN (".$cat_in.")
        ORDER BY i.image_date DESC
        LIMIT 
$num_new_images";
$result $site_db->query($sql);
$num_rows2 $site_db->get_numrows($result);

if (!
$num_rows2)  {
  
$new_images2 "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  
$new_images2 .= $lang['no_new_images'];
  
$new_images2 .= "</td></tr></table>";
}
else  {
  
$new_images2 "<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++ % == 0) ? 2;
      
$new_images2 .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$new_images2 .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

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

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

$site_template->register_vars("new_images2"$new_images2);
unset(
$new_images2);
//--------------------------------- End cat select pic ---------------------------------


4.) trage das in die DB ein:

INSERT INTO 
`4images_settings` ( `setting_name` , `setting_value` ) VALUES
 
'cat_rand_pic''1' );


5.)
in der home.html mittels {new_images2} die Bilder anzeigen.

jetzt kannst du im ACP unter "Kategorie einstellung" die cat_id nummern eintragen,
 von denen die neuesten bilder angezeigt werden sollen.

6.)wollt ihr aber die cat_id nummern eintragen die nicht angezeigt werden sollen, ändert in der SQL abfrage von:

AND i.cat_id IN (".$cat_in.")

auf

AND i.cat_id NOT IN (".$cat_in.")


7.) in lang/deutsch/main.php

$lang
['total_hits_cat_select'] = "Gesamt Hits in der Kategorie: ";


elegant genug?  :mrgreen:
 
 mfg Andi


DB Error: Bad SQL Query: 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, c.cat_name, u.user_name FROM (images i, categories c) LEFT JOIN users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (0)AND i.cat_id IN () ORDER BY i.image_date DESC LIMIT 3
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY i.image_date DESC LIMIT 3' at line 4

You can put a translation in English or Spanish?

There are some things that the google translator, I fail to understand, dsde Step 4,5,6
Plis, thanks...!
« Last Edit: July 15, 2009, 04:42:45 AM by neverkas »
http://www.fullposteo.com.ar/



La nueva forma de compartir tus fotos y vídeos con tus amigos!

The new form to share photos and videos width your friends!

Rembrandt

  • Guest
Re: zwei spalten neue Bilder auf home möglich?
« Reply #37 on: July 15, 2009, 05:34:09 AM »
Hi!
hmpf... why fullquote, please make a litel lesser.

step 4.)
execute the lines in your database off.

step 5.)
 {new_images2} is the new variable for the second images line, insert {new_images2} in the home.html and you can see

step 6.)
write the id numbers you want to see, in ACP row
Quote
AND i.cat_id IN (".$cat_in.")


change the line:
Quote
AND i.cat_id NOT IN (".$cat_in.")
and the pictures of the categories wil not displayed

mfg Andi
« Last Edit: July 15, 2009, 05:48:55 AM by Rembrandt »

Offline neverkas

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
    • FullPosteo
Re: zwei spalten neue Bilder auf home möglich?
« Reply #38 on: July 15, 2009, 05:01:00 PM »
i thank you very much, but there is a problem.
But I shows:
in {new_images} videos and photos
in {new_images2} photos

It appears that you can do so?
only Videos in {new_images2} , Photos Only in {new_images}
or
only Videos in {new_images} , Photos Only in {new_images2}



another query
I point in English this means? because I do not understand
I found it in ACP, but I understand that this can explain me please?
*Kategorie Bilder Anzeigen
*ID Nummern mit , trennen
« Last Edit: July 15, 2009, 06:08:00 PM by neverkas »
http://www.fullposteo.com.ar/



La nueva forma de compartir tus fotos y vídeos con tus amigos!

The new form to share photos and videos width your friends!

Rembrandt

  • Guest
Re: zwei spalten neue Bilder auf home möglich?
« Reply #39 on: July 15, 2009, 07:09:11 PM »
...
zip the index.php as atachment.


Offline neverkas

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
    • FullPosteo
« Last Edit: July 15, 2009, 07:26:26 PM by neverkas »
http://www.fullposteo.com.ar/



La nueva forma de compartir tus fotos y vídeos con tus amigos!

The new form to share photos and videos width your friends!

Rembrandt

  • Guest
Re: zwei spalten neue Bilder auf home möglich?
« Reply #41 on: July 15, 2009, 07:29:31 PM »
your index.php

Offline neverkas

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
    • FullPosteo
Re: zwei spalten neue Bilder auf home möglich?
« Reply #42 on: July 15, 2009, 07:33:15 PM »
Okas srry my translator bad found xD.

Here my file Index.php in zip
http://www.fullposteo.com.ar/



La nueva forma de compartir tus fotos y vídeos con tus amigos!

The new form to share photos and videos width your friends!

Rembrandt

  • Guest
Re: zwei spalten neue Bilder auf home möglich?
« Reply #43 on: July 15, 2009, 07:38:54 PM »
test it !

lang/english/admin.php

//--------------------------------- Start cat select ---------------------------------
$setting['cat_rand_pic'] = "Show Video :<br /><span class=\"smalltext\">insert Cat_id Number from Videos  separate the Cat_Id Numbers with semicolons " "</span>";
//--------------------------------- End cat select ---------------------------------


Video = {new_images2}

mfg Andi
« Last Edit: July 15, 2009, 07:54:57 PM by Rembrandt »

Offline neverkas

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
    • FullPosteo
Re: zwei spalten neue Bilder auf home möglich?
« Reply #44 on: July 15, 2009, 07:47:14 PM »
nothing appears in {new_images2}
and
error in index.php:
DB Error: Bad SQL Query: 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,i.image_DateTimeOriginal, c.cat_name, u.user_name FROM (images i, categories c) LEFT JOIN users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (0)AND i.cat_id IN (1) ORDER BY i.image_date DESC LIMIT 3
Unknown column 'i.image_DateTimeOriginal' in 'field list'

I remove i.image_DateTimeOriginal".$additional_sql.",
but not show only videos, show videos and photos :S
http://www.fullposteo.com.ar/



La nueva forma de compartir tus fotos y vídeos con tus amigos!

The new form to share photos and videos width your friends!

 

Post your comments here