php codes in Content Items einfügen

Fragen zum Entwickeln eigener Addons?

Moderator: General Support Moderators

Forum rules
Forumregeln
Locked
C.K
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Dec 14, 2006 8:15 pm

php codes in Content Items einfügen

Post by C.K » Thu Nov 15, 2007 11:40 pm

hi,
ich möchte php codes in contents einfügen z.B. wenn ich news verfasse  möchte ich das es möglich ist lange scripts in dem conetn reinschreiben kann. oder bei statsischen seiten und nicht seperat über ein iframe  laden.
gibt es eine möglichkeit die richtig funktioniert?
z.B. sind das die news.

Heute.........
...


gibt es was wo so sachen ermöglicht?

Korn.at
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Sun Aug 19, 2007 3:09 pm

Re: php codes in Content Items einfügen

Post by Korn.at » Fri Nov 16, 2007 10:03 am

Morgen!

eval()

Und ein bisschen im Code rumsuchen und -schnipseln ;) Komponente oder so wüsste ich jetzt nicht.

MfG

User avatar
ghosty
Joomla! Ace
Joomla! Ace
Posts: 1023
Joined: Fri Aug 19, 2005 7:42 am

Re: php codes in Content Items einfügen

Post by ghosty » Fri Nov 16, 2007 10:55 am

Halli hallo,

ähm, hast Du Dir das hier schon mal angesehen:
http://extensions.joomla.org/component/ ... Itemid,35/

Ein echt nettes Plugin ;)

Gruess

Pete
Pete Coutts / ghosty · · GMT +1
---------------------------------

C.K
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Dec 14, 2006 8:15 pm

Re: php codes in Content Items einfügen

Post by C.K » Fri Nov 16, 2007 5:19 pm

was hat das mit php codes zu tun? das is doch nur für css ;)

User avatar
leagueman
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Wed Mar 07, 2007 1:23 pm

Re: php codes in Content Items einfügen

Post by leagueman » Sat Nov 17, 2007 2:34 am

bau dir daraus mal n plugin  8)

Code: Select all

<?php

$_MAMBOTS->registerFunction( 'onPrepareContent', 'phpexec' );

function phpexec( $published, &$row, &$params, $page ) {
	
	$regex = "#{php}(.*?){/php}#s";

	if ( !$published ) {
		$row->text = preg_replace( $regex, '', $row->text );
		return true;
	}
	
	$row->text = preg_replace_callback( $regex, 'phpexec_replacer', $row->text );

	return true;
}

function phpexec_replacer(&$matches){
	
	$content = $matches[1];
	
	ob_start();
		eval(" ?> $content <?php ");
        
    return ob_get_clean();
    
}

self-appointed Joomla 1.0.x help desk :-)
leagueman.joomlabasic.com
What I would change in Joomla 1.0.x

User avatar
rdeutz
Joomla! Explorer
Joomla! Explorer
Posts: 355
Joined: Thu Aug 18, 2005 6:50 am
Location: Germany - Aachen
Contact:

Re: php codes in Content Items einfügen

Post by rdeutz » Fri Jan 25, 2008 8:55 am

Best Regards, Robert
My Blog: http://www.robert-deutz.de - follow me on twitter @rdeutz
Professional Services for Joomla! http://rdbs.de - follow on twitter @rdbsnews


Locked

Return to “Entwicklerforum 1.0.x”