Header Links

Open to all! Ask other shopowners for help.
Post Reply
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Header Links

Post by Kofod95 »

This is just a header module that allows you to select infoPages to be shown as links in the header. There is already a supporters code that does something similar, but this one is controlled by the module-configuration instead of a language-file.
I hope it will be useful for some!

//Daniel
You do not have the required permissions to view the files attached to this post.
Last edited by Kofod95 on Fri Aug 12, 2022 10:19 am, edited 1 time in total.
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
Omar_one
Senior Contributor
Posts: 677
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

Re: Header Links

Post by Omar_one »

Hi @Kofod95 ,
after installing the module got this error when I trying to edit ( change the module-configuration)

Code: Select all

Parse error : syntax error, unexpected ';', expecting ']' in
C:\xampp\htdocs\text\admin\includes\actions\modules\infoboxes\edit.php(20) : eval()'d code
on line 1
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Header Links

Post by ecartz »

To get a better error message, you could try changing (in core) line 20 of includes\actions\modules\infoboxes\edit.php to

Code: Select all

try {
  $eval_code = '$keys .= ' . $value['set_function'] . "'" . addslashes($value['value']) . "', '" . $key . "');";
  eval($eval_code);
} catch (ParseError $e) {
  error_log("Could not parse `$eval_code` for [$key]");
  throw $e;
}
This also would move the line of the error to either 22 or 25.
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Header Links

Post by Kofod95 »

Thank you,
Try removing the module (uninstall) and change the ; in line 36 of includes/modules/content/header/cm_heaer_links.php to a ,
I've updated the package in the first post as well.

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Omar_one
Senior Contributor
Posts: 677
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

Re: Header Links

Post by Omar_one »

ecartz wrote: Thu Aug 11, 2022 9:29 pm To get a better error message, you could try changing (in core) line 20 of includes\actions\modules\infoboxes\edit.php to

Code: Select all

try {
  $eval_code = '$keys .= ' . $value['set_function'] . "'" . addslashes($value['value']) . "', '" . $key . "');"
  eval($eval_code);
} catch (ParseError $e) {
  error_log("Could not parse `$eval_code` for [$key]");
  throw $e;
}
This also would move the line of the error to either 22 or 25.
now there error

Code: Select all

Parse error
: syntax error, unexpected 'eval' (T_EVAL) in
C:\xampp\htdocs\test\admin\includes\actions\modules\infoboxes\edit.php
on line
22
Omar_one
Senior Contributor
Posts: 677
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

Re: Header Links

Post by Omar_one »

Kofod95 wrote: Fri Aug 12, 2022 10:17 am Thank you,
Try removing the module (uninstall) and change the ; in line 36 of includes/modules/content/header/cm_heaer_links.php to a ,
I've updated the package in the first post as well.

//Daniel
thats fix the issue.
if I create info page after install the module it's not shown under Pages to link to(module-configuration) , need to uninstall the module and install it again then it will show the new info page

Br
Omar
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Header Links

Post by Kofod95 »

Omar_one wrote: Fri Aug 12, 2022 10:54 am if I create info page after install the module it's not shown under Pages to link to(module-configuration) , need to uninstall the module and install it again then it will show the new info page
Update where new pages show up automatically.
I took a more in-depth look at core and found some help. This also helped me cut down on unnecessary code. Core is an amazing place to look around!

//Daniel
You do not have the required permissions to view the files attached to this post.
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply