hoogteijling
Terugkerende gebruiker
- Lid geworden
- 12 aug 2005
- Berichten
- 4.261
Hallo allemaal,
Al enkele keren de afgelopen weken heb ik een backup teruggezet van onze website omdat ie zonder aanwijsbare oorzaak er mee uit scheid.
Het gaat om www.blaay.nl
's ochtends doet ie het nog gewoon en dan op een willekeurig tijdstip is ie ineens niet meer bereikbaar.
De volgende melding is dan te lezen in de internet browser:
Onderstaand de inhoud van de bewuste PHP file waar ik totaal geen kaas van gegeten heb:
We gebruiken Joomla 1.5.26 trouwens.
Groeten Marcel
Al enkele keren de afgelopen weken heb ik een backup teruggezet van onze website omdat ie zonder aanwijsbare oorzaak er mee uit scheid.
Het gaat om www.blaay.nl
's ochtends doet ie het nog gewoon en dan op een willekeurig tijdstip is ie ineens niet meer bereikbaar.
De volgende melding is dan te lezen in de internet browser:
Code:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/users/b/l/blaayn/www/plugins/content/digifolioinfo.php on line 17
Onderstaand de inhoud van de bewuste PHP file waar ik totaal geen kaas van gegeten heb:
PHP:
<?php
// The general information at the top of each file
/**
* @version 1.5
* @package DigiFolio Plugin
* @copyright Copyright (C) 2005 - 2009 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License, see LICENSE.php
*/
// No direct access allowed to this file
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.plugin.plugin');
class plgContentDigifolioinfo extends JPlugin
{
public function onPrepareContent( &$row, &$params, $page=0 )
{
// A database connection is created
$db = JFactory::getDBO();
// simple performance check to determine whether bot should process further
if ( JString::strpos( $row->text, 'digifolioinfo' ) === false ) {
return true;
}
// expression to search for
$regex = '/\{digifolioinfo (.*)\}/U';
// check whether plugin has been unpublished
if ( !$this->params->get( 'enabled', 1 ) ) {
$row->text = preg_replace( $regex, '', $row->text );
return true;
}
// find all instances of plugin and put in $matches
preg_match_all( $regex, $row->text, $matches );
// Number of plugins
$count = count( $matches[0] );
// plugin only processes if there are any instances of the plugin in the text
if ( $count ) {
$this->_process( $row, $matches, $count, $regex );
}
// No return value
}
// The proccessing function
protected function _process( &$row, &$matches, $count, $regex )
{
foreach ( $matches[1] as $id )
{
$dfolio = $this->_getDFByName( $id );
$html = $this->_createHTML( $dfolio );
$row->text = str_replace( "{digifolioinfo $id}", $html, $row->text );
}
// removes tags without matching module positions
$row->text = preg_replace( $regex, '', $row->text );
}
protected function _getDFByName ( $id )
{
global $mainframe;
$document = &JFactory::getDocument();
$document->addStyleSheet(JURI::base(true).'/components/com_digifolio/assets/digifolio.css');
// Read component parameters into an array
$cparams = JComponentHelper::getParams ('com_digifolio');
$usepopup = $cparams->get('usepopup');
if ($usepopup) {
$header = '<script src="'.JURI::root(true).'/components/com_digifolio/src/js/jquery-1.2.3.pack.js" type="text/javascript">';
$header .= '</script>';
$header .= '
<script src="'.JURI::root(true).'/components/com_digifolio/tpl/fancy/jquery.fancybox-1.0.0.js" type="text/javascript"></script>
<script src="'.JURI::root(true).'/components/com_digifolio/tpl/fancy/jquery.pngFix.pack.js" type="text/javascript"></script>
<link rel="stylesheet" href="'.JURI::root(true).'/components/com_digifolio/tpl/fancy/fancy.css" />
<script type="text/javascript">
$dfolio_cont = jQuery.noConflict();
$dfolio_cont(document).ready(function($) {
$(".photo-link").fancybox({ "zoomSpeedIn": 500, "zoomSpeedOut": 500, "overlayShow": true });
});
</script>';
$mainframe->addCustomHeadTag($header);
}
$db =& JFactory::getDBO();
$name = (int) addslashes( $id );
$query = "SELECT * FROM #__digifolio_projects where id = '$name'";
$db->setQuery( $query );
$digifoliodb = $db->loadObject();
// Read component parameters into an array
$cparams = JComponentHelper::getParams ('com_digifolio');
$digifoliodb->path = JURI::root();
$digifoliodb->imgx = $cparams->get('imgx', 90);
$digifoliodb->imgy = $cparams->get('imgy', 90);
return $digifoliodb;
}
protected function _createHTML( &$digifolio )
{
// Read component parameters into an array
$cparams = JComponentHelper::getParams ('com_digifolio');
$usepopup = $cparams->get('usepopup');
$showhits = $cparams->get('showhits', 0);
$html = '<div class="df_all">';
$html .= '<style>.photo-link, .photo-none { width: '.$digifolio->imgx.'px !important; }</style>';
$html .= '<div class="df_project_img">';
if ($digifolio->image) {
if ($usepopup) {
$html .= ' <a class="photo-link" rel="one-big-group" href="'. $digifolio->path.$digifolio->image .'">';
} else {
$html .= ' <span class="photo-link">';
}
$html .= ' <img src="'.$digifolio->path.$digifolio->image.'" width="'.$digifolio->imgx.'" height="'.$digifolio->imgy.'" title="'.$digifolio->name.'" />';
if ($usepopup) {
$html .= ' </a>';
} else {
$html .= ' </span>';
}
} else {
$html .= ' <span class="photo-none">';
$html .= ' <div style="width:'.$digifolio->imgx.'px; height:'.$digifolio->imgy.'px;"> </div>';
$html .= ' </span>';
}
$html .= '</div>';
$url = '<a href="http://'.$digifolio->www.'" target="_blank">'.$digifolio->www.' </a>';
$ml = $digifolio->email;
if ($showhits) {
$html .= '<div class="df_hits">'.JText::_( 'Hits' ).': '.$digifolio->hits.'</div>';
}
$html .= '<span class="contentheading df_project_names">'.$digifolio->name.'</span><br />';
$html .= '<em>'.$ml.' - '.$url.'</em><hr />';
$html .= $digifolio->description;
$html .= '</div>';
return $html;
}
}
?>
Groeten Marcel
Laatst bewerkt: