geänderte Standardsuchausgabe PHP5

Gesperrt
Oldperl
Beiträge: 4316
Registriert: Do 30. Jun 2005, 22:56
Wohnort: Eltmann, Unterfranken, Bayern
Hat sich bedankt: 6 Mal
Danksagung erhalten: 4 Mal
Kontaktdaten:

geänderte Standardsuchausgabe PHP5

Beitrag von Oldperl »

Problem nach der Standardinstallation mit Beispielen ist z.Bsp. bei der Anzeige der Suchergebnisseite diese Fehlermeldung

Code: Alles auswählen

Warning:  Call-time pass-by-reference has been deprecated - argument passed by value;  If you would like to pass it by reference, modify the declaration of [runtime function name]().  If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file.  However, future versions may not support this any longer.  in /srv/www/xxxxxxx/cms/front_content.php(884) : eval()'d code on line 361
Grund ist eine andere Behandlung der Referenzierung von übergebenen Variablen an Klassen. Die Referenzierung darf nicht mehr beim Instanzieren der Klasse erfolgen

Code: Alles auswählen

$oArticleProp = new Article_Property(& $db, & $cfg);


class Article_Property {
	var $globalConfig;
	var $oDBInstance;

	/**
	 * Constructor
	 * Hint: Call constructor with Article_Property(&$db, &$cfg);
	 * @param  oDBInstance instance of class DB_Contenido
	 * @param  globalConfig
	 */
	function Article_Property($oDBInstance, $globalConfig) {
		$this->globalConfig = $globalConfig;
		$this->oDBInstance = $oDBInstance;
	}
sondern im Constructor der Klasse

Code: Alles auswählen

$oArticleProp = new Article_Property($db, $cfg);  // (changes by oldperl for PHP5)


class Article_Property {
	var $globalConfig;
	var $oDBInstance;

	/**
	 * Constructor
	 * Hint: Call constructor with Article_Property($db, $cfg);  (changes by oldperl for PHP5)
	 * @param  oDBInstance instance of class DB_Contenido
	 * @param  globalConfig
	 */
	function Article_Property(& $oDBInstance, & $globalConfig) {    //(changes by oldperl for PHP5)
		$this->globalConfig = $globalConfig;
		$this->oDBInstance = $oDBInstance;
	}
Und hier nun der geänderte Output für die Standardsuchausgabe

Code: Alles auswählen

<?php
/***********************************************
* Suchausgabe Output
*
* Author      :     Willi Man
* Copyright   :     four for business AG
* Created     :     05-04-2004
* Modified    :     12-07-2005, Andreas Lindner
* Modified    :     18-10-2006, Ortwin Pinke (oldperl) PHP5 compability
************************************************/

#System properties in use:
#Type: searchrange, Name: include
#Contains comma-separated list of cats to be included into search (sub-cats are included automatically)

#Logical combination of search terms with AND or OR

#Includes
cInclude('classes', 'class.search.php');
cInclude('classes', 'class.artspec.php');
cInclude('classes', 'class.template.php');
cInclude('includes', 'functions.api.string.php');
cInclude("frontend", "includes/functions.navigation.php");
cInclude('classes', 'class.article.php');

#Initiliaze template object
if (!is_object($tpl)) {
	$tpl = new Template;
}
$tpl->reset();

#Settings
$oArticleProp = new Article_Property($db, $cfg);  // (changes by oldperl for PHP5)
$iArtspecReference = 2;

$cApiClient = new cApiClient($client);
$sSearchRange = $cApiClient->getProperty('searchrange', 'include');
$aSearchRange = explode(',', $sSearchRange);

#Multilingual settings
$sYourSearchFor = mi18n("Ihre Suche nach");
$sMore = mi18n("weiter");

#Get search term and pre-process it
if (isset ($_GET['searchterm'])) {
	$searchterm = urldecode(strip_tags(htmlentities(stripslashes($_GET['searchterm']))));
}
elseif (isset ($_POST['searchterm'])) {
	$searchterm = urldecode(strip_tags(htmlentities(stripslashes($_POST['searchterm']))));
}
$searchterm = str_replace(' + ', ' AND ', $searchterm);
$searchterm = str_replace(' - ', ' NOT ', $searchterm);
$searchterm_display = $searchterm;

#Get all article specs
$sql = "SELECT
		idartspec, artspec
	FROM
		".$cfg['tab']['art_spec']."
	WHERE
		client=$client AND
		lang=$lang AND
		online=1";

$db->query($sql);
$rows = $db->num_rows();
$aArtspecOnline = array ();
$aArtSpecs = array ();
$c = 1;
$d = 1;
$e = 1;
while ($db->next_record()) {
	$aArtSpecs[] = $db->f('idartspec');
}
$aArtSpecs[] = 0;

$action = $sess->url('front_content.php');

if (strlen(trim($searchterm)) > 0) {
	#Fix for PHP < 4.3
	if( !function_exists( 'html_entity_decode' ) )
	{
		function html_entity_decode( $given_html, $quote_style = ENT_QUOTES )
		{
			$trans_table = array_flip(get_html_translation_table( HTML_SPECIALCHARS, $quote_style ));
			$trans_table['& #39;'] = "'";
			return ( strtr( $given_html, $trans_table ) );
		}
	}

	#Parse search term and set search options
	$searchterm = html_entity_decode($searchterm);

	if (stristr($searchterm, ' or ') === FALSE) {
		$combine = 'and';
	} else {
		$combine = 'or';
	}
	$searchterm = str_replace(' and ', ' ', strtolower($searchterm));
	$searchterm = str_replace(' or ', ' ', strtolower($searchterm));

		$options = array ('db' => 'regexp', // use db function regexp
		'combine' => $combine, // combine searchterms with and
		'exclude' => false, // => searchrange specified in 'cat_tree', 'categories' and 'articles' is excluded, otherwise included (exclusive)
		'cat_tree' => $aSearchRange, // searchrange
		'artspecs' => $aArtSpecs, // array of article specifications => search only articles with these artspecs
	'protected' => true); // => do not search articles or articles in categories which are offline or protected

	$search = new Search($options);

	$cms_options = array ("head", "html", "htmlhead", "htmltext", "text"); // search only in these cms-types
	$search->setCmsOptions($cms_options);

	#Execute search
	$aSearchResults = $search->searchIndex($searchterm, '');

	#Build results page
	if (count($aSearchResults) > 0) {
		$tpl->set('s', 'result_page', mi18n("Ergebnis-Seite").':');

		#Build meessage
		$message = $sYourSearchFor." '".htmlspecialchars(strip_tags($searchterm_display))."' ".mi18n("hat $$$ Treffer ergeben").":";
		$message = str_replace('$$$', count($aSearchResults), $message);
		$tpl->set('s', 'MESSAGE', $message);

		#Number of results per page
		$number_of_results = 10;
		$oSearchResults = new SearchResult($aSearchResults, $number_of_results);

		$num_res = $oSearchResults->getNumberOfResults() + $pdf_count;
		$num_pages = $oSearchResults->getNumberOfPages();
		$oSearchResults->setReplacement('<strong>', '</strong>'); // html-tags to emphasize the located searchterms

		#Get current result page
		if (isset ($_GET['page']) AND is_numeric($_GET['page']) AND $_GET['page'] > 0) {
			$page = $_GET['page'];
			$res_page = $oSearchResults->getSearchResultPage($page);
		} else {
			$page = 1;
			$res_page = $oSearchResults->getSearchResultPage($page);
		}

		#Build links to other result pages
		for ($i = 1; $i <= $num_pages; $i ++) {
			$nextlink = $sess->url('front_content.php?idcat='.$idcat.'&idart='.$idart.'&searchterm='.$searchterm_display.'&page='.$i.$sArtSpecs);
			if ($i == $page) {
				$nextlinks .= '<nobr>&nbsp<strong>'.$i.'</strong>&nbsp;</nobr>';
			} else {
				$nextlinks .= '<nobr>&nbsp;<a href="'.$nextlink.'" title="'.$i.'. '.mi18n("Ergebnisseite anzeigen").'">'.$i.'</a>&nbsp;</nobr>';
			}
		}
		$tpl->set('s', 'PAGES', $nextlinks);

		#Build link to next result page
		if ($page < $num_pages) {
			$n = $page +1;
			$next = $sess->url('front_content.php?idcat='.$idcat.'&idart='.$idart.'&searchterm='.$searchterm.'&page='.$n.$sArtSpecs);
			$nextpage .= '&nbsp;<a href="'.$next.'" title="'.mi18n("nächste Ergebnisseite anzeigen").'">'.mi18n("vor").' ></a>';
			$tpl->set('s', 'NEXT', $nextpage);
		} else {
			$tpl->set('s', 'NEXT', '');
		}

		#Build link to previous result page
		if ($page > 1) {
			$p = $page -1;
			//$pre = $sess->url('index-c-'.$idcat.'-'.$p.'-0.html');
			$pre = $sess->url('front_content.php?idcat='.$idcat.'&idart='.$idart.'&searchterm='.$searchterm.'&page='.$p.$sArtSpecs);
			$prevpage .= '<a href="'.$pre.'" title="'.mi18n("vorherige Ergebnisseite anzeigen").'">< '.mi18n("zurück").'</a>&nbsp;';
			$tpl->set('s', 'PREV', $prevpage);
		} else {
			$tpl->set('s', 'PREV', '');
		}

		if (count($res_page) > 0) {
			$i = 1;
			#Build single search result on result page
			foreach ($res_page as $key => $val) {
				$num = $i + (($page -1) * $number_of_results);
				$oArt = new Article($key, $client, $lang);
				#Get publishing date of article
				$pub_system = $oArt->getField('published');
				$pub_user = trim(strip_tags($oArt->getContent('HEAD', 90)));
				if ($pub_user != '') {
					$show_pub_date = "[".$pub_user."]";
				} else {
					$show_pub_date = '';
					if ($pub_system[8] != '0') {
						$show_pub_date .= $pub_system[8];
					}
					$show_pub_date .= $pub_system[9].'.';
					if ($pub_system[5] != '0') {
						$show_pub_date .= $pub_system[5];
					}
					$show_pub_date .= $pub_system[6].".".$pub_system[0].$pub_system[1].$pub_system[2].$pub_system[3]."]";
					$show_pub_date = "[".$show_pub_date;
				}

				#Get text and headline of current article
				$iCurrentArtSpec = $oArticleProp->getArticleSpecification($key, $lang);
				$aHeadline = $oSearchResults->getSearchContent($key, 'HTMLHEAD', 1);
				$aSubheadline = $oSearchResults->getSearchContent($key, 'HTMLHEAD', 2);
				$text = $oSearchResults->getSearchContent($key, 'HTML', 1);
				$text = capiStrTrimAfterWord($text[0], 200);
				$headline = capiStrTrimAfterWord($aHeadline[0], 200); # conflict with capiStrTrimAfterWord and setReplacement('<strong>', '</strong>')
				$subheadline = capiStrTrimAfterWord($aSubheadline[0], 200);

				$cat_id = $oSearchResults->getArtCat($key);
				$sCatName = getCategoryName($cat_id, $db);  //(changes by oldperl for PHP5)
				$similarity = $oSearchResults->getSimilarity($key);

				$similarity = sprintf("%.0f", $similarity);

				#Send output to template
				$href = $sess->url("front_content.php?idcat=$cat_id&idart=$key");
				$tpl->set('d', 'more', $sMore);
				$tpl->set('d', 'HREF', $href);
				$tpl->set('d', 'TITLE', mi18n("Link zu Suchergebnis").' '.$i);
				$tpl->set('d', 'NUM', $num);
				$tpl->set('d', 'CATNAME', $headline);
				$tpl->set('d', 'HEADLINE', $text);
				$tpl->set('d', 'SUBHEADLINE', $subheadline);
				$tpl->set('d', 'SIMILARITY', $similarity);
				$tpl->set('d', 'TARGET', '_self');
				$tpl->set('d', 'PUB_DATE', $show_pub_date);
				$tpl->next();
				$i ++;

			}
			$tpl->generate('templates/suchausgabe.html');
		}
	} else {
		#No results
		$tpl->set('s', 'MESSAGE', $sYourSearchFor." '".htmlspecialchars(strip_tags($searchterm))."' ".mi18n("hat leider keine Treffer ergeben").".");
		$tpl->set('s', 'NEXT', '');
		$tpl->set('s', 'PREV', '');
		$tpl->set('s', 'PAGES', '');
		$tpl->set('s', 'result_page', '');
		$tpl->generate('templates/suchausgabe.html');
	}

}

class Article_Property {
   var $globalConfig;
   var $oDBInstance;

   /**
    * Constructor
    * Hint: Call constructor with Article_Property($db, $cfg);  (changes by oldperl for PHP5)
    * @param  oDBInstance instance of class DB_Contenido
    * @param  globalConfig
    */
   function Article_Property(& $oDBInstance, & $globalConfig) {    //(changes by oldperl for PHP5)
      $this->globalConfig = $globalConfig;
      $this->oDBInstance = $oDBInstance;
   }

	/**
	 * Get specification of an article
	 *
	 * @param  	$iArticleId
	 * @return  id of article specification
	 */
	function getArticleSpecification($iArticleId, $iLangId) {

		$sqlString = "
			  		SELECT
		            	artspec
		            FROM
		            	".$this->globalConfig['tab']['art_lang']."
		            WHERE
		            	idart = '".$iArticleId."' AND
						idlang = '".$iLangId."'
		            ";

		#echo "<pre>$sqlString</pre>";
		$this->oDBInstance->query($sqlString);

		if ($this->oDBInstance->next_record()) {
			return $this->oDBInstance->f('artspec');
		} else {
			return false;
		}
	}
}
?>
Gruß aus Franken

Ortwin
Zuletzt geändert von Oldperl am Do 19. Okt 2006, 16:22, insgesamt 1-mal geändert.
ConLite 3.0.0-dev, alternatives und stabiles Update von Contenido 4.8.x unter PHP 8.x - Download und Repo auf Gitport.de
phpBO Search Advanced - das Suchwort-Plugin für CONTENIDO 4.9
Mein Entwickler-Blog
emergence
Beiträge: 10653
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence »

verschoben...
sollte mal ausgebessert werden...
*** make your own tools (wishlist :: thx)
djavet
Beiträge: 264
Registriert: Do 22. Jan 2004, 11:31
Kontaktdaten:

Beitrag von djavet »

Hummm I try to change the code and now I receive this message when I search something:

Code: Alles auswählen

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ']' in /hosting/customers/www.datamed.ch/dev/cms/front_content.php(884) : eval()'d code on line 239
Any idea?

Gruss, Dom
emergence
Beiträge: 10653
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence »

Code: Alles auswählen

$trans_table['''] = "'";
should be

Code: Alles auswählen

$trans_table['& #39;'] = "'";
without the space between & #
this is a behavior of this forum...
*** make your own tools (wishlist :: thx)
djavet
Beiträge: 264
Registriert: Do 22. Jan 2004, 11:31
Kontaktdaten:

Beitrag von djavet »

Hello

I change the output module with this updated code and I receive always the error:
http://www.datamed.ch/dev/cms/front_con ... p?idcat=40

Code: Alles auswählen

[19-Oct-2006 19:55:27] PHP Parse error:  parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ']' in /hosting/customers/www.datamed.ch/dev/cms/front_content.php(884) : eval()'d code on line 239
Output:

Code: Alles auswählen

<?php
/***********************************************
* Suchausgabe Output
*
* Author      :     Willi Man
* Copyright   :     four for business AG
* Created     :     05-04-2004
* Modified    :     12-07-2005, Andreas Lindner
* Modified    :     18-10-2006, Ortwin Pinke (oldperl) PHP5 compability
************************************************/

#System properties in use:
#Type: searchrange, Name: include
#Contains comma-separated list of cats to be included into search (sub-cats are included automatically)

#Logical combination of search terms with AND or OR

#Includes
cInclude('classes', 'class.search.php');
cInclude('classes', 'class.artspec.php');
cInclude('classes', 'class.template.php');
cInclude('includes', 'functions.api.string.php');
cInclude("frontend", "includes/functions.navigation.php");
cInclude('classes', 'class.article.php');

#Initiliaze template object
if (!is_object($tpl)) {
   $tpl = new Template;
}
$tpl->reset();

#Settings
$oArticleProp = new Article_Property($db, $cfg);  // (changes by oldperl for PHP5)
$iArtspecReference = 2;

$cApiClient = new cApiClient($client);
$sSearchRange = $cApiClient->getProperty('searchrange', 'include');
$aSearchRange = explode(',', $sSearchRange);

#Multilingual settings
$sYourSearchFor = mi18n("Ihre Suche nach");
$sMore = mi18n("weiter");

#Get search term and pre-process it
if (isset ($_GET['searchterm'])) {
   $searchterm = urldecode(strip_tags(htmlentities(stripslashes($_GET['searchterm']))));
}
elseif (isset ($_POST['searchterm'])) {
   $searchterm = urldecode(strip_tags(htmlentities(stripslashes($_POST['searchterm']))));
}
$searchterm = str_replace(' + ', ' AND ', $searchterm);
$searchterm = str_replace(' - ', ' NOT ', $searchterm);
$searchterm_display = $searchterm;

#Get all article specs
$sql = "SELECT
      idartspec, artspec
   FROM
      ".$cfg['tab']['art_spec']."
   WHERE
      client=$client AND
      lang=$lang AND
      online=1";

$db->query($sql);
$rows = $db->num_rows();
$aArtspecOnline = array ();
$aArtSpecs = array ();
$c = 1;
$d = 1;
$e = 1;
while ($db->next_record()) {
   $aArtSpecs[] = $db->f('idartspec');
}
$aArtSpecs[] = 0;

$action = $sess->url('front_content.php');

if (strlen(trim($searchterm)) > 0) {
   #Fix for PHP < 4.3
   if( !function_exists( 'html_entity_decode' ) )
   {
      function html_entity_decode( $given_html, $quote_style = ENT_QUOTES )
      {
         $trans_table = array_flip(get_html_translation_table( HTML_SPECIALCHARS, $quote_style ));
         $trans_table['''] = "'";
         return ( strtr( $given_html, $trans_table ) );
      }
   }

   #Parse search term and set search options
   $searchterm = html_entity_decode($searchterm);

   if (stristr($searchterm, ' or ') === FALSE) {
      $combine = 'and';
   } else {
      $combine = 'or';
   }
   $searchterm = str_replace(' and ', ' ', strtolower($searchterm));
   $searchterm = str_replace(' or ', ' ', strtolower($searchterm));

      $options = array ('db' => 'regexp', // use db function regexp
      'combine' => $combine, // combine searchterms with and
      'exclude' => false, // => searchrange specified in 'cat_tree', 'categories' and 'articles' is excluded, otherwise included (exclusive)
      'cat_tree' => $aSearchRange, // searchrange
      'artspecs' => $aArtSpecs, // array of article specifications => search only articles with these artspecs
   'protected' => true); // => do not search articles or articles in categories which are offline or protected

   $search = new Search($options);

   $cms_options = array ("head", "html", "htmlhead", "htmltext", "text"); // search only in these cms-types
   $search->setCmsOptions($cms_options);

   #Execute search
   $aSearchResults = $search->searchIndex($searchterm, '');

   #Build results page
   if (count($aSearchResults) > 0) {
      $tpl->set('s', 'result_page', mi18n("Ergebnis-Seite").':');

      #Build meessage
      $message = $sYourSearchFor." '".htmlspecialchars(strip_tags($searchterm_display))."' ".mi18n("hat $$$ Treffer ergeben").":";
      $message = str_replace('$$$', count($aSearchResults), $message);
      $tpl->set('s', 'MESSAGE', $message);

      #Number of results per page
      $number_of_results = 10;
      $oSearchResults = new SearchResult($aSearchResults, $number_of_results);

      $num_res = $oSearchResults->getNumberOfResults() + $pdf_count;
      $num_pages = $oSearchResults->getNumberOfPages();
      $oSearchResults->setReplacement('<strong>', '</strong>'); // html-tags to emphasize the located searchterms

      #Get current result page
      if (isset ($_GET['page']) AND is_numeric($_GET['page']) AND $_GET['page'] > 0) {
         $page = $_GET['page'];
         $res_page = $oSearchResults->getSearchResultPage($page);
      } else {
         $page = 1;
         $res_page = $oSearchResults->getSearchResultPage($page);
      }

      #Build links to other result pages
      for ($i = 1; $i <= $num_pages; $i ++) {
         $nextlink = $sess->url('front_content.php?idcat='.$idcat.'&idart='.$idart.'&searchterm='.$searchterm_display.'&page='.$i.$sArtSpecs);
         if ($i == $page) {
            $nextlinks .= '<nobr>&nbsp<strong>'.$i.'</strong>&nbsp;</nobr>';
         } else {
            $nextlinks .= '<nobr>&nbsp;<a href="'.$nextlink.'" title="'.$i.'. '.mi18n("Ergebnisseite anzeigen").'">'.$i.'</a>&nbsp;</nobr>';
         }
      }
      $tpl->set('s', 'PAGES', $nextlinks);

      #Build link to next result page
      if ($page < $num_pages) {
         $n = $page +1;
         $next = $sess->url('front_content.php?idcat='.$idcat.'&idart='.$idart.'&searchterm='.$searchterm.'&page='.$n.$sArtSpecs);
         $nextpage .= '&nbsp;<a href="'.$next.'" title="'.mi18n("nächste Ergebnisseite anzeigen").'">'.mi18n("vor").' ></a>';
         $tpl->set('s', 'NEXT', $nextpage);
      } else {
         $tpl->set('s', 'NEXT', '');
      }

      #Build link to previous result page
      if ($page > 1) {
         $p = $page -1;
         //$pre = $sess->url('index-c-'.$idcat.'-'.$p.'-0.html');
         $pre = $sess->url('front_content.php?idcat='.$idcat.'&idart='.$idart.'&searchterm='.$searchterm.'&page='.$p.$sArtSpecs);
         $prevpage .= '<a href="'.$pre.'" title="'.mi18n("vorherige Ergebnisseite anzeigen").'">< '.mi18n("zurück").'</a>&nbsp;';
         $tpl->set('s', 'PREV', $prevpage);
      } else {
         $tpl->set('s', 'PREV', '');
      }

      if (count($res_page) > 0) {
         $i = 1;
         #Build single search result on result page
         foreach ($res_page as $key => $val) {
            $num = $i + (($page -1) * $number_of_results);
            $oArt = new Article($key, $client, $lang);
            #Get publishing date of article
            $pub_system = $oArt->getField('published');
            $pub_user = trim(strip_tags($oArt->getContent('HEAD', 90)));
            if ($pub_user != '') {
               $show_pub_date = "[".$pub_user."]";
            } else {
               $show_pub_date = '';
               if ($pub_system[8] != '0') {
                  $show_pub_date .= $pub_system[8];
               }
               $show_pub_date .= $pub_system[9].'.';
               if ($pub_system[5] != '0') {
                  $show_pub_date .= $pub_system[5];
               }
               $show_pub_date .= $pub_system[6].".".$pub_system[0].$pub_system[1].$pub_system[2].$pub_system[3]."]";
               $show_pub_date = "[".$show_pub_date;
            }

            #Get text and headline of current article
            $iCurrentArtSpec = $oArticleProp->getArticleSpecification($key, $lang);
            $aHeadline = $oSearchResults->getSearchContent($key, 'HTMLHEAD', 1);
            $aSubheadline = $oSearchResults->getSearchContent($key, 'HTMLHEAD', 2);
            $text = $oSearchResults->getSearchContent($key, 'HTML', 1);
            $text = capiStrTrimAfterWord($text[0], 200);
            $headline = capiStrTrimAfterWord($aHeadline[0], 200); # conflict with capiStrTrimAfterWord and setReplacement('<strong>', '</strong>')
            $subheadline = capiStrTrimAfterWord($aSubheadline[0], 200);

            $cat_id = $oSearchResults->getArtCat($key);
            $sCatName = getCategoryName($cat_id, $db);  //(changes by oldperl for PHP5)
            $similarity = $oSearchResults->getSimilarity($key);

            $similarity = sprintf("%.0f", $similarity);

            #Send output to template
            $href = $sess->url("front_content.php?idcat=$cat_id&idart=$key");
            $tpl->set('d', 'more', $sMore);
            $tpl->set('d', 'HREF', $href);
            $tpl->set('d', 'TITLE', mi18n("Link zu Suchergebnis").' '.$i);
            $tpl->set('d', 'NUM', $num);
            $tpl->set('d', 'CATNAME', $headline);
            $tpl->set('d', 'HEADLINE', $text);
            $tpl->set('d', 'SUBHEADLINE', $subheadline);
            $tpl->set('d', 'SIMILARITY', $similarity);
            $tpl->set('d', 'TARGET', '_self');
            $tpl->set('d', 'PUB_DATE', $show_pub_date);
            $tpl->next();
            $i ++;

         }
         $tpl->generate('templates/suchausgabe.html');
      }
   } else {
      #No results
      $tpl->set('s', 'MESSAGE', $sYourSearchFor." '".htmlspecialchars(strip_tags($searchterm))."' ".mi18n("hat leider keine Treffer ergeben").".");
      $tpl->set('s', 'NEXT', '');
      $tpl->set('s', 'PREV', '');
      $tpl->set('s', 'PAGES', '');
      $tpl->set('s', 'result_page', '');
      $tpl->generate('templates/suchausgabe.html');
   }

}

class Article_Property {
   var $globalConfig;
   var $oDBInstance;

   /**
    * Constructor
    * Hint: Call constructor with Article_Property($db, $cfg);  (changes by oldperl for PHP5)
    * @param  oDBInstance instance of class DB_Contenido
    * @param  globalConfig
    */
   function Article_Property(& $oDBInstance, & $globalConfig) {    //(changes by oldperl for PHP5)
      $this->globalConfig = $globalConfig;
      $this->oDBInstance = $oDBInstance;
   }

   /**
    * Get specification of an article
    *
    * @param     $iArticleId
    * @return  id of article specification
    */
   function getArticleSpecification($iArticleId, $iLangId) {

      $sqlString = "
                 SELECT
                     artspec
                  FROM
                     ".$this->globalConfig['tab']['art_lang']."
                  WHERE
                     idart = '".$iArticleId."' AND
                  idlang = '".$iLangId."'
                  ";

      #echo "<pre>$sqlString</pre>";
      $this->oDBInstance->query($sqlString);

      if ($this->oDBInstance->next_record()) {
         return $this->oDBInstance->f('artspec');
      } else {
         return false;
      }
   }
}
?>
What can I do?

Regards, Dominique
Oldperl
Beiträge: 4316
Registriert: Do 30. Jun 2005, 22:56
Wohnort: Eltmann, Unterfranken, Bayern
Hat sich bedankt: 6 Mal
Danksagung erhalten: 4 Mal
Kontaktdaten:

Beitrag von Oldperl »

Hello Dominique,

seems that's not working with copy&paste here.
Whatever, i zippt u the xml-file of the modul.

Here's the downloadlink for it

:arrow: Suchausgabe.zip

Hope this will work.

Another way u may try, change the code-fragments in the original modul by hand in the modul the way i told in my first post.
If u didn't save the orig. modul, try to go back in modulhistory since u find the orig. code.

Regards from Franken

Ortwin
ConLite 3.0.0-dev, alternatives und stabiles Update von Contenido 4.8.x unter PHP 8.x - Download und Repo auf Gitport.de
phpBO Search Advanced - das Suchwort-Plugin für CONTENIDO 4.9
Mein Entwickler-Blog
djavet
Beiträge: 264
Registriert: Do 22. Jan 2004, 11:31
Kontaktdaten:

Beitrag von djavet »

Thx a lot. Work like a charm with your zip.

I appreciate the help and the forum!

Regards,
Dominique
Gesperrt