Support MemHT, Vote Now!
MemHT Portal is a Free PHP CMS and Blog
It permit the creation and the management online of websites with few and easy steps.
It's completelly customizable, expandable and suitable for all needs.
     Site demo
Moderators: mem paulo89 adminik
RSSReply
Same Function Name
AuthorText
JPappi
Senior Member
Avatar

Posts: 292
Contributes: 69

Gender: _MALE_
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

Image
Delete Edit Quote
 
mem
MemHT's Dad
Admin / Developer

Avatar

Posts: 3886
Contributes: 1161

Gender: _MALE_
Online: No

Languages: English, Italian, Macedonian, Serbian
Date: 25/07/2008 11:57
Re: Same Function Name
#post10494
Yes of course
Image
MemHT Portal - Free PHP CMS and Blog

"Great works are performed, not by strength, but by perseverance."
Samuel Johnson

READ THIS before posting your support question in the forum!
Delete Edit Quote
 
JPappi
Senior Member
Avatar

Posts: 292
Contributes: 69

Gender: _MALE_
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

Image
Delete Edit Quote
 
mem
MemHT's Dad
Admin / Developer

Avatar

Posts: 3886
Contributes: 1161

Gender: _MALE_
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
Image
MemHT Portal - Free PHP CMS and Blog

"Great works are performed, not by strength, but by perseverance."
Samuel Johnson

READ THIS before posting your support question in the forum!
Delete Edit Quote
 
JPappi
Senior Member
Avatar

Posts: 292
Contributes: 69

Gender: _MALE_
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

Image
Delete Edit Quote
 
mem
MemHT's Dad
Admin / Developer

Avatar

Posts: 3886
Contributes: 1161

Gender: _MALE_
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
Image
MemHT Portal - Free PHP CMS and Blog

"Great works are performed, not by strength, but by perseverance."
Samuel Johnson

READ THIS before posting your support question in the forum!
Delete Edit Quote
 
JPappi
Senior Member
Avatar

Posts: 292
Contributes: 69

Gender: _MALE_
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

Image
Delete Edit Quote
 
mem
MemHT's Dad
Admin / Developer

Avatar

Posts: 3886
Contributes: 1161

Gender: _MALE_
Online: No

Languages: English, Italian, Macedonian, Serbian
Date: 25/07/2008 12:54
Re: Same Function Name
#post10502
I hope so Smile I'll get results in 2 weeks
Image
MemHT Portal - Free PHP CMS and Blog

"Great works are performed, not by strength, but by perseverance."
Samuel Johnson

READ THIS before posting your support question in the forum!
Delete Edit Quote
 
sanchez
Junior Member
Avatar

Posts: 67
Contributes: 66

Gender: _NEUTRAL_
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

Smile
Edited: 25/07/2008 14:43
Delete Edit Quote
 
mem
MemHT's Dad
Admin / Developer

Avatar

Posts: 3886
Contributes: 1161

Gender: _MALE_
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
Image
MemHT Portal - Free PHP CMS and Blog

"Great works are performed, not by strength, but by perseverance."
Samuel Johnson

READ THIS before posting your support question in the forum!
Delete Edit Quote
 
Reply
Tags Cloud
Advertising
News Archive
Language
Help MemHT Portal
Navigator
Search
Users Block
Hi Guest
IP: 38.103.63.60

Username
Password
New files
MemHT Wiki
Friends
MemHT Portal is a free software released under the GNU/GPL License by Miltenovik Manojlo