| | |
| Stránka: 1 z 1
| [ Príspevkov: 3 ] | |
Autor | Správa |
---|
Registrovaný: 24.11.09 Prihlásený: 21.05.20 Príspevky: 195 Témy: 75 | Napísal elo: 20.09.2010 14:27 | |
|
Dobry den,
prosim Vas akym prikazom mozem nacitat php do druheho suboru.
Vysvetlim:
Mam spraveny web a potrebujem do jedneho uz fungujuceho suboru vlozit este kod z druheho php suboru, ked som to len prekopiroval, nenacitalo mi to vsetko, asi chyba v cestach, preto by bolo jednoduchsie to tahat priamo z povodneho suboru, lebo je to robene v Joomla a v administracii ba bol zmatok.
Dakujem za pomoc.
E.
|
|
Registrovaný: 17.07.08 Prihlásený: 24.01.13 Príspevky: 143 Témy: 37 | Napísal tomxi: 20.09.2010 16:58 | |
|
_________________ PC: Procesor: INTEL Core i7-860, grafika: MSI R4890 Cyclone OC, 1GB DDR5, doska: Gigabyte GA-P55-UD3R, zdroj: Fortron 700W Everest 700 80+, RAM: 2x2GB Corsair XMS3 DHX |
|
Registrovaný: 24.11.09 Prihlásený: 21.05.20 Príspevky: 195 Témy: 75 | Napísal autor témy elo: 20.09.2010 17:06 | |
|
Toto je subor s vyhladavanim:
Kód: <?php
// no direct access defined( '_JEXEC' ) or die( 'Restricted access' );
global $Itemid; $configx = $this->config; $makemods = $this->makemods; $lists = $this->lists;
$configx = $this->config;
$task = JRequest::getVar('task', '');
EZAutosHelper::EZHeader();
$link1 = JRoute::_( 'index.php?option=com_ezautos&controller=listings&task=results&Itemid='. $Itemid );
?>
<?php if ( $configx->ea_usemakmod ) { ?>
<script language="javascript" type="text/javascript"> <!--
var makemods = new Array; <?php $i = 0; foreach ($makemods as $k=>$items) { foreach ($items as $v) { echo "makemods[".$i++."] = new Array( '$k','".addslashes( $v->value )."','".addslashes( $v->text )."' );\n\t\t"; } } ?>
//--> </script> <?php } ?>
<br/><br/>
<table width="90%" align="center" cellpadding="5"><tr><td>
<table width="100%" cellpadding="10" class="listtableborder"><tr><td>
<form name="adminForm" id="adminForm" action="<?php echo JRoute::_("index.php?");?>" method="get"> <input type="hidden" name="option" value="com_ezautos" /> <input type="hidden" name="controller" value="listings" /> <input type="hidden" name="task" value="results" /> <input type="hidden" name="Itemid" value="<?php echo $Itemid;?>" /> <?php if (!$configx->ea_usecat) { ?> <input type="hidden" name="cid" value="0" /> <?php } if (!$configx->ea_usetype) { ?> <input type="hidden" name="type" value="0" /> <?php } if (!$configx->ea_usemakmod) { ?> <input type="hidden" name="make" value="0" /> <input type="hidden" name="model" value="0" /> <?php } if (!$configx->ea_usetrans) { ?> <input type="hidden" name="trans" value="0" /> <?php } if (!$configx->ea_useeng) { ?> <input type="hidden" name="engine" value="0" /> <?php } if (!$configx->ea_usefuel) { ?> <input type="hidden" name="fuel" value="0" /> <?php } if (!$configx->ea_usecond) { ?> <input type="hidden" name="tag" value="0" /> <?php } if (!$configx->ea_usepcode) { ?> <input type="hidden" name="postcode" value="" /> <input type="hidden" name="radius" value="" /> <?php } if (!$configx->ea_usecolour) { ?> <input type="hidden" name="colour" value="0" /> <?php } if (!$configx->ea_usedoors) { ?> <input type="hidden" name="doors" value="0" /> <?php } if (!$configx->ea_usebody) { ?> <input type="hidden" name="body" value="0" /> <?php } if (!$configx->ea_maxmiles) { ?> <input type="hidden" name="maxmiles" value="0" /> <?php } if (!$configx->ea_useyear) { ?> <input type="hidden" name="minyear" value="0" /> <input type="hidden" name="maxyear" value="0" /> <?php } if ($configx->ea_sitetype!=0) { ?> <input type="hidden" name="minprice" value="" /> <input type="hidden" name="maxprice" value="" /> <?php } if (!$configx->ea_usekeyword) { ?> <input type="hidden" name="keyword" value="" /> <?php } ?> <input type="hidden" name="type" value="0" />
<table border="0" width="100%"> <tr> <td class="h2"><?php echo JText::_('EZAUTOS_SEARCHADV');?><br /><br /></td> </tr> <tr> <td>
<table border="0" cellspacing="2" cellpadding="5" class="formbkgr"> <?php if ($configx->ea_usetype) { ?> <tr> <td><?php echo JText::_('EZAUTOS_TRANSACTION_TYPE');?>:-</td> <td colspan="2"><?php echo $lists['type'];?></td> </tr> <?php } if ($configx->ea_usecond) { ?> <tr> <td><?php echo JText::_('EZAUTOS_VLDET_TAG');?>:-</td> <td colspan="2"><?php echo $lists['tag'];?></td> </tr> <?php } if ($configx->ea_usecat) { ?> <tr> <td><?php echo JText::_('EZAUTOS_SEARCHVEHTYPE');?>:-</td> <td colspan="2"><?php echo $lists['cid'];?></td> </tr> <?php } if ( $configx->ea_sitetype==0 ) { ?> <tr> <td width="130"><?php echo JText::_('EZAUTOS_SEARCHPRICE');?>:-</td> <td><?php echo $lists['minprice'];?></td> <td><?php echo $lists['maxprice'];?></td> </tr> <?php } if ($configx->ea_useyear) { ?> <tr> <td width="130"><?php echo JText::_('EZAUTOS_SEARCH_AGERANGE');?>:-</td> <td><?php echo $lists['minyear'];?></td> <td><?php echo $lists['maxyear'];?></td> </tr>
<?php } if ($configx->ea_usemakmod) { ?> <tr> <td><?php echo JText::_('EZAUTOS_SEARCH_MAKE').' '. JText::_('EZAUTOS_SEARCH_MODEL');?>:-</td> <td><?php echo $lists['maid'];?></td> <td><?php echo $lists['moid'];?></td> </tr> <?php } if ($configx->ea_useeng) { ?> <tr> <td><?php echo JText::_('EZAUTOS_VLDET_ENG');?>:-</td> <td colspan="2"><?php echo $lists['engine'];?></td> </tr> <?php } if ($configx->ea_usetrans) { ?> <tr> <td><?php echo JText::_('EZAUTOS_DDSL_TRANS');?>:-</td> <td colspan="2"><?php echo $lists['trans'];?></td> </tr> <?php } if ($configx->ea_usefuel) { ?> <tr> <td><?php echo JText::_('EZAUTOS_VLDET_FUEL');?>:-</td> <td colspan="2"><?php echo $lists['fuel'];?></td> </tr> <?php } if ($configx->ea_usecolour) { ?> <tr> <td><?php echo JText::_('EZAUTOS_VLDET_COLOUR');?>:-</td> <td colspan="2"><?php echo $lists['colour'];?></td> </tr> <?php } if ($configx->ea_usedoors) { ?> <tr> <td><?php echo JText::_('EZAUTOS_SEARCH_DOORS');?>:-</td> <td colspan="2"><?php echo $lists['doors'];?></td> </tr> <?php } if ($configx->ea_usebody) { ?> <tr> <td><?php echo JText::_('EZAUTOS_SPECS_BODY');?>:-</td> <td colspan="2"><?php echo $lists['body'];?></td> </tr> <?php } if ($configx->ea_maxmiles) { ?> <tr> <td><?php echo JText::_('EZAUTOS_SCHMILES');?>:-</td> <td colspan="2"><input name="maxmiles" class="searchfield" maxlength="10" type="text" /></td> </tr> <?php } if ($configx->ea_usepcode){ ?> <tr> <td><?php echo JText::_('EZAUTOS_SEARCH_PCODEAREA');?>:-</td> <td colspan="2"><input name="postcode" class="slimfield" maxlength="6" type="text" /> <?php echo $lists['my_radius'];?></td> </tr> <?php } if ($configx->ea_usekeyword){ ?> <tr> <td><?php echo JText::_('Keyword');?>:-</td> <td colspan="2"><input name="keyword" class="searchfield" maxlength="10" type="text" /></td> </tr> <?php } ?>
<tr> <td><?php echo JText::_('EZAUTOS_SEARCH_SEARCHORD');?>:-</td> <td colspan="2"><select name="direction" class="searchbox"> <option value="DEFAULT"><?php echo JText::_('EZAUTOS_DDSL_DEFAULT');?></option> <option value="ASCPRICE"><?php echo JText::_('EZAUTOS_DDSL_PRASC');?></option> <option value="DESCPRICE"><?php echo JText::_('EZAUTOS_DDSL_PRDESC');?></option> <option value="ASCID"><?php echo JText::_('EZAUTOS_DDSL_IDASC');?></option> <option value="DESCID"><?php echo JText::_('EZAUTOS_DDSL_IDDESC');?></option> </select></td> </tr> <tr> <td></td> <td colspan="2"><input class="button" type="submit" name="submit" value="<?php echo JText::_('EZAUTOS_INCLUDES_SEARCH');?>" /></td> </tr> </table>
</td> </tr> </table> </form>
</td></tr></table>
<br /><br /><br />
</td></tr></table> Tuto potrebujem vlozit formlular vyssie popisany: Kód: <?php
// no direct access defined( '_JEXEC' ) or die( 'Restricted access' );
[b]include('components/com_ezautos/views/listings/tmpl/search.php');[/b]
global $Itemid;
EZAutosHelper::EZHeader();
$user =& JFactory::getUser(); $configx = $this->config; $category = $this->category; $rows = $this->rows; $pageNav = $this->pageNav;
if (!$configx->ea_colcount){ $colcount = "4"; } else { $colcount = $configx->ea_colcount; } if (!$configx->ea_colwidth){ $colwidth = "25%"; } elseif ($configx->ea_colwidth && !$configx->ea_colcount){ $colwidth = "25%"; } else { $colwidth = $configx->ea_colwidth; }
if ($configx->ea_listtemplate) { define("TEMPLATE_PATH","components/com_ezautos/forms/list_templates/".$configx->ea_listtemplate); } else { define("TEMPLATE_PATH","components/com_ezautos/forms/list_templates/template2"); }
?>
<br /> <table width="100%" border="0" cellspacing="1" cellpadding="4"> <tr> <td class="sectiontableheader"><?php echo stripslashes($category->name);?></td> </tr> </table>
<?php
$num_rows=ceil( count( $rows ) / 1 ); if ($num_rows > 0) {
if ($configx->ea_listtemplate == 'multicolumn') {
echo "<table border='0' width='100%'>"; echo "<tr>";
$rowcounter = 0; foreach($rows as $row) {
$number = $row->price;
if ($configx->ea_currencyformat==0) {
$formatted_price = number_format($number); } else { $formatted_price = number_format($number, 2,",","."); }
if (($rowcounter%$colcount==0) AND ($rowcounter<>0)) echo "</tr><tr>";
if (file_exists(TEMPLATE_PATH.'/listshort.ezautos.php')) { include(TEMPLATE_PATH.'/listshort.ezautos.php'); } else { echo JText::_('EZAUTOS_TEMPLATE_ERROR'); }
$rowcounter++; } if ($rowcounter%$colcount<>0) { for ($i = 1; $i <= ($colcount-($rowcounter%$colcount)); $i++) { echo "<td width='$colwidth' valign='top'> </td>"; } } echo "</tr></table>";
} else {
$k = 0; for ($i=0, $n=count( $rows ); $i < $n; $i++) { $row = &$rows[$i];
$number = $row->price;
if ($configx->ea_currencyformat==0) {
$formatted_price = number_format($number); } else { $formatted_price = number_format($number, 2,",","."); }
if (file_exists(TEMPLATE_PATH.'/listshort.ezautos.php')) { include(TEMPLATE_PATH.'/listshort.ezautos.php'); } else { echo JText::_('EZAUTOS_TEMPLATE_ERROR'); }
}
}
}else{
?>
<table width='100%' border='0' cellspacing='1' cellpadding='0'> <tr> <td class='h3'><br /><br /><?php echo JText::_('EZAUTOS_NOCATLISTINGS');?><br /><br /><br /></td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%" class="sectiontableheader"> <tr> <td><img src="<?php echo JURI::root();?>components/com_ezautos/images/pixel.gif" border="0" height="2" width="1" alt="" /></td> </tr> </table>
<?php
}
?> <?php $link = JRoute::_( 'index.php?option=com_ezautos&controller=categories&task=view&Itemid='. $Itemid ); ?>
<form name="pageForm" action="<?php $link;?>" method="get"> <input type="hidden" name="option" value="<?php echo $option;?>" /> <input type="hidden" name="controller" value="categories" /> <input type="hidden" name="task" value="<?php echo $_REQUEST['task'];?>" /> <input type="hidden" name="id" value="<?php echo $_REQUEST['id'];?>" /> <input type="hidden" name="Itemid" value="<?php echo $Itemid;?>" />
<table width='100%' border='0' cellspacing='1' cellpadding='0'> <tr> <td colspan="2"><div align="center"><?php echo $pageNav->writeLinks($link); ?></div></td> </tr> <tr> <td><?php echo $pageNav->writeCounter();?></td><td><div align="right"><?php echo JText::_('EZAUTOS_LISTINGS_DISPLAYNUM');?> <?php echo $pageNav->getBox($link);?></div></td> </tr> </table>
</form>
Ten tucny kod som tam vlozil, skusal som aj bez zatvoriek, zial nepomohlo. ( include('components/com_ezautos/views/listings/tmpl/search.php'); )
Cesta k search.php components/com_ezautos/views/listings/tmpl
Cesta k views.php components/com_ezautos/views/categories/tmpl
Asi bude potrebne upravit cesty v php ale neviem kde, poradi niekto?
Dakujem.
|
|
| Stránka: 1 z 1
| [ Príspevkov: 3 ] | |
Podobné témy | Témy | Odpovede | Zobrazenia | Posledný príspevok |
---|
| Nacitanie obsahu PHP subora na serveri v PHP, ASP | 4 | 429 | 25.12.2010 23:44 Blackshadow | | Načítanie obsahu v HTML, XHTML, XML, CSS | 11 | 756 | 12.12.2010 15:40 evryl | | nacitanie obsahu suboru v PHP, ASP | 4 | 1010 | 13.02.2009 17:55 _fortes_ | | nacitanie obsahu suboru do premennej v JavaScript, VBScript, Ajax | 9 | 1091 | 05.03.2008 13:45 stenley | | nacitanie obsahu suboru do pola v C v Assembler, C, C++, Pascal, Java | 5 | 2137 | 28.04.2011 10:39 Fico | | PHP a načítanie url v PHP, ASP | 5 | 877 | 15.01.2010 13:30 stenley | | Odoslanie obsahu tagu cez JS do PHP v JavaScript, VBScript, Ajax | 17 | 1271 | 27.05.2009 18:06 roach189 | | Načítanie .png z uploadnutého php ... v PHP, ASP | 13 | 537 | 12.01.2009 6:59 d0.0b | | wordpress plugin - nacitanie php suboru +include css suborov v Redakčné systémy | 9 | 1470 | 20.03.2014 7:23 don jebot | | Načítanie php súboru len pre jednu špecifickú url ... v PHP, ASP | 2 | 676 | 11.12.2009 18:22 d0.0b | | zobrazení obsahu v HTML, XHTML, XML, CSS | 2 | 631 | 14.05.2009 20:22 Solda | | Neidexovanie obsahu v Internetový marketing, SEO, reklama | 1 | 398 | 12.03.2014 10:51 JanoF | | Prekopirovanie obsahu webstranky v JavaScript, VBScript, Ajax | 12 | 665 | 25.08.2009 21:38 awtt | | Blokovanie nevhodného obsahu v Bezpečnosť a firewally | 1 | 577 | 20.03.2012 7:50 Ivuso | | Kopirovanie obsahu textboxu v JavaScript, VBScript, Ajax | 2 | 691 | 11.04.2008 0:25 chrono | | Podstrcenie obsahu podadresara v Internetový marketing, SEO, reklama | 0 | 419 | 19.04.2012 22:23 blazej44800 |
| Nemôžete zakladať nové témy v tomto fóre Nemôžete odpovedať na témy v tomto fóre Nemôžete upravovať svoje príspevky v tomto fóre Nemôžete mazať svoje príspevky v tomto fóre
|
|