PHP v Joomle

Programovacie jazyky, rady, poradňa...
jorg22
Medium Professional
Medium Professional
Používateľov profilový obrázok
Príspevky: 1087
Registrovaný: 12 aug 2006, 20:39
Kontaktovať používateľa:

PHP v Joomle

Príspevok od používateľa jorg22 »

Pls ako dostanem do redakcneho systemu Joomla php kod?
mastermind
VIP
VIP
Používateľov profilový obrázok
Príspevky: 4810
Registrovaný: 09 feb 2005, 13:17

Príspevok od používateľa mastermind »

hmm nie je on nahodou cely napisany v php? :)
chrono
VIP
VIP
Používateľov profilový obrázok
Príspevky: 7127
Registrovaný: 25 dec 2006, 15:17

Príspevok od používateľa chrono »

V textovom editore si otvoríš niektorý súbor a pridáš tam to, čo tam potrebuješ pridať. (ale ktorý súbor budeš musieť upraviť závisí od toho, čo presne potrebuješ urobiť)
jorg22
Medium Professional
Medium Professional
Používateľov profilový obrázok
Príspevky: 1087
Registrovaný: 12 aug 2006, 20:39
Kontaktovať používateľa:

Príspevok od používateľa jorg22 »

vo tej Joomle je nejaky online editor na vytvaranie stranky.A do toho potrebuje dostat PHP kod.Zistil som ze to uklada asi do SQL databazy tam som pridal php kod ale nevykonal sa ani ziadny text iny sa tam neulozil.Neviem ako to je robene.
Napr toto:

Kód: Vybrať všetko

http://jorg.ic.cz/index.php?option=com_content&task=view&id=14&Itemid=32
chcem aby som mohol ukladat vyrobky do databazy a ono to tam bude nacitavat.Php kodspravitviem ale neviemho tam dostat.
Dufam zeto niekto pochopi :)
turtlak69
Guru
Guru
Príspevky: 2896
Registrovaný: 10 máj 2007, 15:58
Bydlisko: /dev/null

Príspevok od používateľa turtlak69 »

do mysql neulozis ziaden php kod. jedine tak html + javascript. ine sa ti nevykona
jorg22
Medium Professional
Medium Professional
Používateľov profilový obrázok
Príspevky: 1087
Registrovaný: 12 aug 2006, 20:39
Kontaktovať používateľa:

Príspevok od používateľa jorg22 »

nasiel som na nete nejaky plugin MOSmodule ale nefim jak sa s nim robi, nerozumiem tomu.

Kód: Vybrať všetko

http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,944/Itemid,35/
Tu je readme:
The hightlight of this new release are:
- Minor bug fix for Firefox compatibility
- Video param for use with video service like: YouTube, Yahoo video, Google Video service or any flash video file from your own site.
- VideoEgg param for use with VideoEgg video service.
- textsizer param for use to resize text using an id tag and can be skin via "tsizerlink" and "tsizerbutton"

Description: MosModule mambot has the ability to display nested article, textsizer, embeded video in a content, exec snippet written in PHP (without <?php ?> tags) and exec external php script file pass with parameter (with <?php ?> tags). You can see an example of that in "mosmodule\hello.php". (See more detail below)

In my mind, MosModule would give me the potential of reusing article that are common to all article without repeating the same content, make my article more dynamic enrich with php code using snippet or external php script file. With the use of the parameters and querystring you can pass variable between mosmodule and the external php script. The possibilities are endless!

For support: http://ongetc.com/index.php?option=com_ ... Itemid=175
Download info: http://ongetc.com/index.php?option=com_ ... Itemid=192


Features & Usage:
. Run as legacy mambot support and ability to run inside module (see below)
. MosModule is a mambot to displays any module, article, textsizer, video, exec snippet and external php script inside a content item.
. Use mosmodule to get RSS feeds from anywhere using the user module with RSS URL
. external script: Please see hello.php for a sample on passing variable between mosmodule and external script

Note:
. Important: Make sure to save the setting at least once and enable MosModule in Mambot manager!
. This is a rewrite of modulebot to be compatible with Mambo 4.5.1 or above
. The default folder for external script is "mosmodule" but you can change it in param screen
. Snippet should not have <?php ?> tags where as phpinc should have the tags
. By default, the module will fill the width of the content area. If you wish to control the width and positioning of modules in content area, you will want to enclose the mosmodule tag(s) in a div and either assign a class to controll the display in your template_css.css file, or use inline styles (if you are using a WYSIWYG editor, you will need to switch to source mode in order to create the <div> tag).


Usage: (Note: extra space to avoid parsing the mambot)

{ mosmodule list} - Displays a list of available modules and block positions.
{ mosmodule module=modulename1,(optional:module2,module3,etc} - Ex: {mosmosule module=Search,poll}
{ mosmodule random=FAQ,(option:title)} - Displays the entire section randomly, default to don't show title
{ mosmodule articleid=2,(optional:introtext|fulltext|all)} - Displays an article inside another article, default is all
{ mosmodule codeid=2} - Displays an article inside another article as code listing
{ mosmodule snippet=2} - Execute and displays an article inside another article as PHP code
{ mosmodule phpinc=hello.php,firtname,lastname} - Include php file, Execute and displays an inside an article
{ mosmodule video=Video_url} - Play embed video from YouTube, Yahoo Video, Google Video or any embed flash video
{ mosmodule videoegg=VE_Path} - VideoEgg Path to your uploaded video file.
{ mosmodule textsizer=idtag} - textsizer to resize text by passing the id tag of your content


Complex Usage: (Note: extra space to avoid parsing the mambot)

. phpinc: Some working sample
+ Assuming your hello.php is in {yourcmsroot}/yourfolder/hello.php then you would put this in your content
{ mosmodule phpinc=hello.php,firtname,lastname}

>>>>>NOTE: You will need to create a folder called 'mosmodule' in the root directory. Your php scripts will go here. This folder's path can be changed by altering the 'Foldername' parameter in the mosmodule setup


. video: Some working sample from YouTube, Yahoo video, and Google video
+ YouTube: { mosmodule video=
+ Yahoo Video: { mosmodule video=http://us.i1.yimg.com/cosmos.bcst.yahoo ... eoSolo.swf}
+ Google Video: { mosmodule video=http://video.google.com/googleplayer.sw ... 2214&hl=en}

. videoEgg: Some working sample from VideoEgg
+ VideoEgg : { mosmodule videoegg=/gid328/cid1096/9B/2Q/1171378165tCRacTofc58XDo0sWG5H}


Legacy mambot notes:
. copy {ROOT}/mambots/content/mosmodule.php to {ROOT}/mambots


=== Read this, only if you want to use mosmodule in user module ===

- To run inside a module to call other module, hack the includes/frontend.html.php around line 51

Replace this: echo $module->content;

With this:
$mosmodulefunc=$mosConfig_absolute_path."/mambots/content/mosmodule/mosmodule_func.php";
if (file_exists($mosmodulefunc)) { include_once($mosmodulefunc); }
if (function_exists('mosmodule_bot')) { echo mosmodule_bot($module->content); }
else echo $module->content;

or this to allow php code in module
$mosmodulefunc=$mosConfig_absolute_path."/mambots/content/mosmodule/mosmodule_func.php";
if (function_exists('mosmodule_bot')) { echo eval('?>'.mosmodule_bot($module->content).'<?php '); }
else echo eval('?>'.$module->content.'<?php ');

=== Read this, only if you want to use mosmodule in user module ===

Credit:
. Daryl Coulthart for contribute to multi-module parameter
. denis69 for idea to load intro or fulltext instead of the entire article
. Rastarr for idea to make title optional for random section
. Imperialdata for suggestion to improve readme file
. Ron Severdia for inspiration on textsizer

Any donation will be appreciated!
chrono
VIP
VIP
Používateľov profilový obrázok
Príspevky: 7127
Registrovaný: 25 dec 2006, 15:17

Príspevok od používateľa chrono »

turtlak69 napísal:do mysql neulozis ziaden php kod. jedine tak html + javascript. ine sa ti nevykona
V php je funkcia eval, pomocou ktorej sa dá vykonať aj php kód, ktorý bol uložený napr. v databáze.
turtlak69
Guru
Guru
Príspevky: 2896
Registrovaný: 10 máj 2007, 15:58
Bydlisko: /dev/null

Príspevok od používateľa turtlak69 »

hmm dobre vediet... najblizsie skusim.. mysilm, ze tato funkcia teda usetri zbytocne subory a uchova ako taky poriadok teda. idem nieco o tom nastudovat (php.net)

edit: ma tak napadlo, ze ci to funguje aj napriklad takto:
"zobacik"html"zobacik"
nejaky text napriklad tabulky divy atd

"zobacik"?php
nejaky dlhy skript
echo "nejaky text + $premenna";
?"zobacik"
pokracovanie html

a ukoncenie

slo by to aj v kombinacii s html + php + java?

ako by to potom vyzeralo? hmm? dajme tomu, ze cez mysq_query som vybral nieco v DB. dajme tomu, ze je to nieco take ako som napisal. ako by to potom malo vyzerat. pre priklad ten text v DB by bol v premennej $db_text.
mastermind
VIP
VIP
Používateľov profilový obrázok
Príspevky: 4810
Registrovaný: 09 feb 2005, 13:17

Príspevok od používateľa mastermind »

na tie vyrobky si musis stiahnut nejaky modul, alebo komponent. cez ten editor neurobis nic.
chrono
VIP
VIP
Používateľov profilový obrázok
Príspevky: 7127
Registrovaný: 25 dec 2006, 15:17

Príspevok od používateľa chrono »

turtlak69 napísal:...
Funkcia eval celý reťazec spracuje ako php kód. Na začiatku a teda nebude <?php (to preto, lebo už v sekcii s php si). Ten tvoj príklad by teda vyzeral takto:

Kód: Vybrať všetko

$tst = "nejaky dlhy skript
echo "nejaky text + $premenna";
?>
 pokracovanie html
<?php";
<?php na konci môže byť, ale funguje to aj bez toho.
Php kód sa spracováva od začiatku, takže ak tam chceš vložiť napr. html, musíš tam dať ?>; teda:

Kód: Vybrať všetko

$tst="?>html kod
<?php
php kod";
Celé sa to potom vykoná pomocou eval($tst);
jorg22
Medium Professional
Medium Professional
Používateľov profilový obrázok
Príspevky: 1087
Registrovaný: 12 aug 2006, 20:39
Kontaktovať používateľa:

Príspevok od používateľa jorg22 »

uz som si nasiel spravny plugin ale nejde mi nainstalovat.Instaloval som to ako mabobot.

Kód: Vybrať všetko

http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,60/Itemid,35/
mastermind
VIP
VIP
Používateľov profilový obrázok
Príspevky: 4810
Registrovaný: 09 feb 2005, 13:17

Príspevok od používateľa mastermind »

preco to chces zababrat vlastnymi skriptami? preco nenajdes nejaky mod na tie produkty. isto je ich kopa.
jorg22
Medium Professional
Medium Professional
Používateľov profilový obrázok
Príspevky: 1087
Registrovaný: 12 aug 2006, 20:39
Kontaktovať používateľa:

Príspevok od používateľa jorg22 »

tak ja som to chcel riesit tak ale nic vhodne som nenasiel.Malo byto byt podobne ako agem.Lahsie sa mi zda spravit script ako furt hladat na nete mozno ani nicvyhovujuse nenajdem.Ak mas dake linky na taketo mody tak to sem hod ja vyskusam vsetko.
mastermind
VIP
VIP
Používateľov profilový obrázok
Príspevky: 4810
Registrovaný: 09 feb 2005, 13:17

Príspevok od používateľa mastermind »

ty potrebujes komplet eshop?
jorg22
Medium Professional
Medium Professional
Používateľov profilový obrázok
Príspevky: 1087
Registrovaný: 12 aug 2006, 20:39
Kontaktovať používateľa:

Príspevok od používateľa jorg22 »

ee iba ten katalog staci.Keby som robil script tak by bol dost jednoduchy na to ele kedye mi nejde PHP tak to je problem.
//edit:
OK uz som to vyriesil trosku nepraktickym sposobom ale facha pohoda.
Napísať odpoveď