Member
Member
elliott   2010-11-14, 17:01
#1

I am using the default theme. I have enabled the user_login-out plugin.

The logout link shows (on the same line as the link to ZenPhoto site), but when logged out, there is no login link showing.

What di I need to do to get a login link to show?

Administrator
Administrator
acrylian   2010-11-14, 18:11
#2

You will have to modify your theme. This plugin does either show a login form (see the doc) or nothing if you are not logged in (I thought it does actually but it apperently it does not...).

Add this to your theme
`if(zp_loggedin()) {

} else {

}

If you use modrewrite the login link is always /admin.

Member
Member
elliott   2010-11-15, 07:04
#3

Sorry that I am not understanding exactly what I need to do. I have a very limited grasp on writing PHP code.

I am assuming that I need to modify the "index.php", "album.php", and "image.php" files in the default theme folder..... is that correct?

I tried adding the code you showed above ... I put it just under the link to ZenPhoto site, and I wrapped the PHP tags around it as the other functions have. But when I tried to open the page, I got an error message pointing to that line that has

I am thinking that I was supposed to add in code there, but I have no idea what code to add.

Can you be a bit more specific about the code I need to add and where to add it.

Administrator
Administrator
acrylian   2010-11-15, 10:34
#4

The code above was an example and `` is a placeholder that is by no means vaild code of any language... (which is IMHO quite obviously...) You have to replace that with the proper functions of the plugin and the normal login link which I gave you. Please look at the documentation of the plugin and also read the theming tutorial to get familiar with Zenphoto themes.

I strongly recommend to learn a few PHP basics first before even trying to modify a theme. This is fairly basic stuff.

Member
Member
elliott   2010-11-15, 14:14
#5

Well, I am quite sure that you being a super expert and all that the above is easy for you to say.

But the truth is that I have been able to modify the default theme nicely so far. All new colors, a custom header above the non-existing header to make the page look like the rest of the website pages, and a few other customizations.

The only problem I have run into is making your "user_login-out plugin" do what you infer that it is supposed to do (put a login and a logout link on the page).

I would have sent you a donation if I could get this to work. I thought perhaps your user forum was the place to get the help I need, I guessed wrong.

I think appropriate for the situation here and in keeping with the topic, is a friendly reminder of that old ZEN saying, “Before enlightenment; chop wood, carry water. After enlightenment; chop wood, carry water.” I won't require you to go read any elusive documentation to understand the meaning of it, I will share that with you here. Even after one becomes a PHP Guru one cannot simply sit and bask in the wonderment of it all, rather one should still perform, even enjoy, the mundane tasks.

Member
Member
sbillard   2010-11-15, 14:51
#6

You might just want to look at the options for that plugin.

We look forward to your donation!

Administrator
Administrator
acrylian   2010-11-15, 16:11
#7

[i]Well, I am quite sure that you being a super expert and all that the above is easy for you to say.[/i]
Just to make clear this does not require to be a PHP expert. On this forum we generally help to help yourself.

If you set the plugin option sbillard refers you will get the login form shown directly. If you don't want that you have to do what I told you. It's really a simple if/else things. The plugin has just one function which I referred to and as you can see on its documentation. So here a quick example again with some REAL code:

`
if(zp_loggedin()) {
printUserLogin_out();
} else {
echo '

Member
Member
elliott   2010-11-15, 19:08
#8

My sincere thanks to acrylian who remembered after-all that even the mundane stuff matters to some of us who are not as familiar with PHP coding.

The "real code" you posted worked great with a couple of minor changes which I am posting below.... only in case some other dummy like me needs the help one day. The code I ended up using is:

if(zp_loggedin()) {
printUserLogin_out();
} else {
echo '/zp-core/admin.php">Login';
}

The minor changes included
(1) using /zp-core/admin.php instead of just /admin
(2) using the same quote mark at the end of the path to admin that was used at the beginning

Thank you again for the help and most important for restoring my belief that web developers [b]are[/b] a friendly bunch, always willing to help out and share the knowledge. I put through a donation ... you truly deserve it!

Administrator
Administrator
acrylian   2010-11-15, 19:20
#9

re: (1): If you don't use mod-rewrite that is the correct link (I really assume everyone use that by now..)
re: (2): was a typo of course.

Member
Member
elliott   2010-11-16, 01:33
#10

You don't have to post this reply on the forum after reviewing it... it really is just a message to acrylian who I now am convinced is a really terrific person..... and serves no other purpose, so everyone else need not read it...... I didn't add the corrections to make you look bad, I'm sure everyone will know it was a typo and all.... I just thought that someone with the same problem as I will read this one day and get a good simple, direct answer from your forum archives. That's what forums are for, after all.

And I really do have to check out that "mod-rewrite" thing. Whatever it is.... maybe when I get some free time and am totally bored of life, I can go read all about it. Meanwhile it's been a long day and quoting the Hitchhiker's Guide to the Galaxy (fun book in case you are bored and in need of a terrific diversion).... "so long and thanks for all the fish".

Administrator
Administrator
acrylian   2010-11-16, 11:39
#11

I guess we have again here some missunderstanding of written text as it happens frequently on the net.. My post was just meant as a clarification.

Your website is about Web design and development. Forgive me that I am wondering a little that someone working in this area does not know what modrewrite is. You really should at least have heard about what that is for. Just a friendly advise...

The answer to everything is of course 42...;-)

Member
Member
elliott   2010-11-16, 14:35
#12

And an excellent clarification it was.... proof being that my client's photo Gallery is now working fine.

And since you are wondering how someone can own a web development company and not know what modrewrite is .... I feel compelled to answer. DON'T PANIC ;-) I'll fill you in.

I am 65. After teaching school for 20 years; raising 3 kids, a husband, and various dogs, cats, and other hangeroners; I decided the new technology field was more productive and a heck-of-a-lot more fun and there would be no school board to boss me around. Realizing that my old Cobol and Fortran training was absolutely no use at all anymore, I self-taught, eventually started my web dev company in ’99 and am still learning.

Actually I have several very talented "younger" people who join the team for projects beyond my scope. This current project not being that difficult, I didn’t want to pay my PHP programmer the obscene price he requires so I muddled through this one on my own. I'll put the modrewrite on my to-do list since you seem to feel it is of major importance.... I always know where my towel is ;-)

Administrator
Administrator
acrylian   2010-11-16, 15:23
#13

Thanks, of course you didn't have to justify yourself..;-) I am a few decades younger but actually coming from design and illustration I am also mainly self taught in regards to PHP programming (other than my collegue sbillard btw). I started with PHP some years ago as I realized the need to be able to setup CMSs for clients. Actually you never stop learning with all computer and web related stuff at all anyway.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.