| Same Function Name |
| Author | Text |
JPappi Senior Member

Posts: 292

Gender:  Online: No |
Date: 25/07/2008 11:55 Same Function Name | #post10493 | I cant start on homepage with blogs and mylinks, cause the have the same function for the categs.
Got an error: cannot redeclare catList......
Can i change one of the function names? JPappi - have fun with memHT
Project at work: Find-4u.de
|
|
 |
| |
mem MemHT's Dad Admin / Developer

Posts: 3886

Gender:  Online: No
Languages: English, Italian, Macedonian, Serbian |
Date: 25/07/2008 11:57 Re: Same Function Name | #post10494 | Yes of course |
|
 |
| |
JPappi Senior Member

Posts: 292

Gender:  Online: No |
Date: 25/07/2008 12:04 Re: Same Function Name | #post10495 | Ok, thanks
Another prob. I want to set mylinks on top of the homepage. So i have to use a Mylinks.html and an array in mylinks page. I have many tries but my array wont work. Whats nessecairy, array for catList or showCategory, or both. Where i have to set the array? JPappi - have fun with memHT
Project at work: Find-4u.de
|
|
 |
| |
mem MemHT's Dad Admin / Developer

Posts: 3886

Gender:  Online: No
Languages: English, Italian, Macedonian, Serbian |
Date: 25/07/2008 12:09 Re: Same Function Name | #post10496 | Just put an include in root/index.php after inclding the default homepage
| code | if (file_exists("pages/".$siteConfig['defpage']."/index.php")) {
include("pages/".$siteConfig['defpage']."/index.php");
} else if ($row = $dblink->get_row("SELECT content FROM memht_virtualpages WHERE name='".$siteConfig['defpage']."'")) {
//VIRTUAL PAGES (Added in 3.8.0)
eval(outCodeVP($row['content']));
}
include("pages/mylinks/index.php"); |
I thing should work |
|
 |
| |
JPappi Senior Member

Posts: 292

Gender:  Online: No |
Date: 25/07/2008 12:25 Re: Same Function Name | #post10497 | Hm, we've talk about this solution.
At this time i include mylinkspage in a block an set it on the top of homepage. It works fine. Is there a SEO prob?
If no its oka for me, but my prefered solution is a html file. JPappi - have fun with memHT
Project at work: Find-4u.de
|
|
 |
| |
mem MemHT's Dad Admin / Developer

Posts: 3886

Gender:  Online: No
Languages: English, Italian, Macedonian, Serbian |
Date: 25/07/2008 12:39 Re: Same Function Name | #post10500 | No problems with SEO, all links will still point to the mylinks page |
|
 |
| |
JPappi Senior Member

Posts: 292

Gender:  Online: No |
Date: 25/07/2008 12:45 Re: Same Function Name | #post10501 | OK, thanks for today, i hope you got big success yesterday. JPappi - have fun with memHT
Project at work: Find-4u.de
|
|
 |
| |
mem MemHT's Dad Admin / Developer

Posts: 3886

Gender:  Online: No
Languages: English, Italian, Macedonian, Serbian |
Date: 25/07/2008 12:54 Re: Same Function Name | #post10502 | I hope so  I'll get results in 2 weeks |
|
 |
| |
sanchez Junior Member

Posts: 67

Gender:  Online: No |
Date: 25/07/2008 14:42 Re: Same Function Name | #post10503 | if they use the same function and the function contains the same code then you can do the following, which will test if the function is loaded already and if it is then it will not try to load it a second time.
| code |
if(!function_exists('catList')){
function catList()
{
cat list code stuff goes here
}
}
|
this way you can include multiple files and not get "function already declared" errors.
Hope this helps
 Edited: 25/07/2008 14:43 |
|
 |
| |
mem MemHT's Dad Admin / Developer

Posts: 3886

Gender:  Online: No
Languages: English, Italian, Macedonian, Serbian |
Date: 25/07/2008 15:26 Re: Same Function Name | #post10509 | Yes it can be called like that, but i do not use it because what is he doing is not a normal operation but a mod and obviously a lot of incompatibilities could occur |
|
 |
| |