If this is your first visit, check our documentation. To post, register or login.

ez page off/on?

Started by munchie on 20 Jul 2011, 8:40 AM · Views: 2,636

Results 21 to 36 of 36
6 Jan 2012, 1:09 AM
#21
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #21 by gjh42

These "multiple double negative" logic situations can be very tricky to work out correctly. I'll pick this apart bit by bit and see whether it is right as is or needs tweaking.```php

<?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) { if (!($var_linksList[$i]['name'] == 'Login' and $_SESSION['customer_id']) or !($var_linksList[$i]['name'] == 'Logoff' and !$_SESSION['customer_id'])) { ?>
<a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a><?php echo ($i < $n ? EZPAGES_SEPARATOR_HEADER : '') . "\n"; ?>
<?php } //end if } // end FOR loop ?>
If this is the login link and customer is logged in, the first section is true. "True" gives a false result for this part due to the leading "not" (!). 
If this is the logoff link and customer is not logged in, the second section is true. Again, "true" gives a false result for this part due to the leading "not" (!). 
At least one of these sections must result in true for the overall test to be true (the "or" linking them).
Anything but login link and logged in makes the first section false, giving a "true" result for it.
Anything but logoff link and not logged in makes the second section false, giving a "true" result for it.
The current link can't be both login and logoff, so at least one of these has to result in true, making the overall test always true.

So it needs an "and" instead of "or" joining the sections. Running through it again that way, we get:

Both of these sections must result in true for the overall test to be true (the "and" linking them).
Anything but login link and logged in makes the first section false, giving a "true" result for it.
Anything but logoff link and not logged in makes the second section false, giving a "true" result for it.
Login link and logged in makes the first section true, giving a "false" result and thus a false overall test (hiding the login link). 
Logoff link and not logged in makes the second section true, giving a "false" result and thus a false overall test (hiding the logoff link). 

So that's it: change the "or" to "and" in the middle of the if() statement.
6 Jan 2012, 8:49 PM
#22
keekee avatar

keekee

New Zenner

Join Date:
Dec 2011
Posts:
22
Plugin Contributions:
0

Post #22 by keekee

Well I tried really hard I'm pretty good at C&P and I did go change the ' or ' to ' and ' and the page won't even load.

It stops at the ez bar and there is just a line where the bar is suppose to be.

I changed it back to the original file but will leave the two ez links for a little while and watch this thread.

keescraps.com

May all beings give and receive compassion, Live free from fear, And dwell in peace. - author
unknown

7 Jan 2012, 12:24 AM
#23
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #23 by gjh42

I can't tell anything from looking at the output, except that both links are displaying. Can you post your code in that part of the file (with surrounding lines for context)? If the output cut off at the ez-pages bar, that would indicate an error you made while editing. An incorrectly functioning test would only affect whether or not those links display.
Do you have the latest error log in your /cache/ folder? That would say where it broke if there was a PHP error.

7 Jan 2012, 1:15 AM
#24
keekee avatar

keekee

New Zenner

Join Date:
Dec 2011
Posts:
22
Plugin Contributions:
0

Post #24 by keekee

You mean an error like this?

[06-Jan-2012 19:29:33] PHP Warning: require(includes/templates/template_default/templates/tpl_ezpages_bar_header.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /mounted-storage/home86b/sub002/sc11665-DVNB/keescraps.com/includes/templates/simply_kerrin/common/tpl_header.php on line 101

If I paste back in the same block that was taken out and replaced with the newer then it works.

The block of text you said find then replace it with the modded sort of stands out.

It's been a long time since I messed with php, was back when setting up phpbb2.

I'm only grabbing that one block of code.

May all beings give and receive compassion, Live free from fear, And dwell in peace. - author
unknown

7 Jan 2012, 1:17 AM
#25
keekee avatar

keekee

New Zenner

Join Date:
Dec 2011
Posts:
22
Plugin Contributions:
0

Post #25 by keekee

OH and I opened it in notepad ++ so I could see all the stuff in there that regular notepad doesn't show.

May all beings give and receive compassion, Live free from fear, And dwell in peace. - author
unknown

7 Jan 2012, 1:32 AM
#26
keekee avatar

keekee

New Zenner

Join Date:
Dec 2011
Posts:
22
Plugin Contributions:
0

Post #26 by keekee

I looked at it again and thought maybe I was suppose to be putting it in the default instead of the simplykerrin template but that didn't work either.

May all beings give and receive compassion, Live free from fear, And dwell in peace. - author
unknown

7 Jan 2012, 1:37 AM
#27
keekee avatar

keekee

New Zenner

Join Date:
Dec 2011
Posts:
22
Plugin Contributions:
0

Post #27 by keekee

This is where it stops when I leave the page alone with the mod in place.

<!--bof-branding display--> <div id="logoWrapper">
<div id="taglineWrapper">
  <div id="tagline">Welcome to KeeScraps</div>
</div>
</div> <br class="clearBoth" /> <!--eof-branding display--> <!--eof-header logo and navigation display--> <!--bof-header ezpage links-->

May all beings give and receive compassion, Live free from fear, And dwell in peace. - author
unknown

7 Jan 2012, 10:59 PM
#28
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #28 by gjh42

Then what you are doing definitely causes a PHP error in (or before) the ez-pages headerbar processing.

The error log is saying that tpl_ezpages_bar_header.php does not exist in either /template_default/templates/ or /simply_kerrin/templates/.

7 Jan 2012, 11:15 PM
#29
keekee avatar

keekee

New Zenner

Join Date:
Dec 2011
Posts:
22
Plugin Contributions:
0

Post #29 by keekee

It does in the default but NOT in the kerrins.

Out of curiosity since there was only one file in the the kerrin templates folder on my server (which is tpl_modules_catagories_tabs.php) I looked in the unzipped file on my computer to see if I missed uploading something and in there also is only that one file.

Shoot now I wonder what else should be there or if I need to only worry about that if I change something in the default folder.

May all beings give and receive compassion, Live free from fear, And dwell in peace. - author
unknown

8 Jan 2012, 1:51 AM
#30
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #30 by gjh42

You should never change a file in the default folder. If you want to change one that is not already in your custom template folder, copy it to the custom folder and make your changes to that copy.

Something must be wrong in your system if the correct file is there but not being found.

8 Jan 2012, 2:08 AM
#31
keekee avatar

keekee

New Zenner

Join Date:
Dec 2011
Posts:
22
Plugin Contributions:
0

Post #31 by keekee

Thank you very much for the guidance. I'm learning as I go.
I'll update when I get things going.

I wouldn't have a clue as to what is wrong anywhere in things unless something doesn't work (Like the contact us) I have to rely on kind souls like yourself to muddle my way.

This is my first try with a shopping cart and also going to a different discussion board system than the phpbb2 I did in the past.

May all beings give and receive compassion, Live free from fear, And dwell in peace. - author
unknown

23 Jan 2012, 3:37 AM
#32
keekee avatar

keekee

New Zenner

Join Date:
Dec 2011
Posts:
22
Plugin Contributions:
0

Post #32 by keekee

Finally... After showing the host that a DNS check showed problems they made some changes and some things like the contact us and this script started working.
The DNS check still shows problems but they say there is nothing else to change that the SSL is set right and that is what matters but is making the check show wrong. HUH??? (no answer expected there just splaining things).

I've looked into moving but so far host I've looked at say not to try to move till the domain is at least 60 days old.

The script works fine in the EZ bar header but the footer doesn't. It still shows Login and Logout as separate not switching.
Am I setting something wrong?
I thought with any of the 3 turned on they would all act the same. (sidebox isn't on).

The ez pages sort order is Login 5 Logout 6 no TOC ticked (same window).
Shouldn't the Login be set to SSL since they are entering information?

May all beings give and receive compassion, Live free from fear, And dwell in peace. - author
unknown

23 Jan 2012, 3:55 AM
#33
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #33 by gjh42

Each location (header, footer, sidebox) has its own module and tpl_ files. You need to make the same changes for each location.

The login link probably should be set to SSL. Don't know for sure if it will make a difference - try it both ways and see how it loads. It will submit the info securely in any case.

23 Jan 2012, 6:58 AM
#34
keekee avatar

keekee

New Zenner

Join Date:
Dec 2011
Posts:
22
Plugin Contributions:
0

Post #34 by keekee

Well Duh! (excuse me while I put my brain back in). Of course it's a different tlp,

OK so basically it's the same code but looking at it then wouldn't the div id change to footer?

Also would the capitalized words ' EZPAGES_SEPARATOR_HEADER ' change?

I'm trying to get this.

May all beings give and receive compassion, Live free from fear, And dwell in peace. - author
unknown

23 Jan 2012, 3:02 PM
#35
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #35 by gjh42

Yes, various references would change from header to footer or whatever. Use the existing footer file as your guide. It uses EZPAGES_SEPARATOR_FOOTER to give the separator content.

23 Jan 2012, 8:26 PM
#36
keekee avatar

keekee

New Zenner

Join Date:
Dec 2011
Posts:
22
Plugin Contributions:
0

Post #36 by keekee

GOT IT :clap:
That's one more checked off the list.

Thank you so very much for all your help.

On to why google chrome is red slashing my https and I should finally be ready to start setting up things :)

May all beings give and receive compassion, Live free from fear, And dwell in peace. - author
unknown