421
Mazarin
Re: Paid access to some parts of the website
  • 2009/1/18 11:34

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


I'm sure there's a prettier way, but you could always just add an "else" with the text and leave the true if clause blank



422
Mazarin
Re: Paid access to some parts of the website
  • 2009/1/18 10:08

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


Please excuse the layman's terms in trying to describe where I'm trying to do this, but I still haven't been able to fully grasp how everything is connected here.

I'm trying to write the code in a template (globalnav.html, or rather I'm including a php page where I write the code) that's controlling a horizontal navigation bar just under the "header" of the page. This template is in turn included in the theme.html file. (here is the demo for the theme, as my site isn't online yet http://xoops4noobs.ovh.org/index.php? ... _select=blueday_dynamique). I assume that attaching the file here won't help as the problem doesn't actually lay in the code itself, but rather how it is connected to a number preceding files.

What I'm trying to achieve is to have additional options in the dropdown menus from this menubar depending on which user group the user belong to.



423
Mazarin
Re: Paid access to some parts of the website
  • 2009/1/17 19:14

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


Thanks for putting up with my n00bish questions (and for sort of hijacking this thread).

I got it working within a module now, so thank you very much. I think what confused me a bit was the part that I still can't get to work, i.e. the menu. I am currently using the blue day dynamique theme, which has a menu for navigation just before the content of the site. I would very much like to reflect these restrictions within the module also in the menu, so that the users who don't have access won't even get a menu option to go there.

However, this menu part is where I still can't get the system to pick up any other uid than 0.



424
Mazarin
Re: Paid access to some parts of the website
  • 2009/1/17 14:11

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


Yes, that makes sense. I also noticed that the extra user goes away after a while. However, why do I only get uid=0 and not the real uid when I try to get the user with the code (even after the "extra" user has disappeared)?



425
Mazarin
Re: Paid access to some parts of the website
  • 2009/1/17 11:31

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


Thanks for taking your time Trabis, and your code may very well work. However, I wouldn't know because it simply will not pick up my uid as anything else than 0, regardless of which user I use to log in with. And I suspect this has nothing to do with your code, as this is the case regardless if I use any custom code or not.

Let me give you an example using the the standard system who's online block:
I use my regular computer and go to my site. The who's online block shows 1 guest. I log in, and the block shows 1 guest and 1 user. I use my server to go to the site as well and the block show 2 guests and 1 user. I log in with a different user and the block shows 2 guests and 2 users.

It seems whenever I'm logged on, the system sees me as both a guest and a user, and I just can't seem to get hold of any other ID than the guest ID. Why?



426
Mazarin
Re: Paid access to some parts of the website
  • 2009/1/16 22:24

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


Hmm, I still can't get it to work. Though, looking at userinfo.php and seeing this line:
$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
makes me think this should be something like it. Are we perhaps getting confused by different implementations in different versions of XOOPS here? I run 2.3.2b myself.

In addition, I get some really weird results when experimenting with this. When I use the code above and print the results onscreen, it seems the system classifies me as an anonymous user, even though I'm an admin. Also, if I look at the Who's online block, the system has registered two users online (1 user, 1 anonymous), even though I only have one connection to the server (and this is fresh after reboot of both server and client, so no other connections have been made). Weird...or perhaps (more likely) I'm just a n00b...



427
Mazarin
Problem displaying special characters (åäö) from custom database
  • 2009/1/16 13:30

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


I run 2.3.2b and am developing my own module, which retrieves data from a custom mySQL database (set up manually) on the same server as Xoops. However, I have a problem displaying Swedish special characters (åäö) retrieved from the database. Both the database and the php page are in UTF-8 format, and if I just write the text manually in the php, the special characters look fine in the browser.

Any ideas on what might be causing this and what I can do to remedy it?

Of course, I could use the htmlentities function on all database strings when writing them, but that's rather tedious and not a very elegant solution. And of course, the data from the XOOPS database displays åäö just fine, so it must be possible somehow.



428
Mazarin
Re: Paid access to some parts of the website
  • 2009/1/16 6:51

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


That makes sense. I'll try that tonight. Thanks!



429
Mazarin
Re: Paid access to some parts of the website
  • 2009/1/15 23:02

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


I'm also looking for something like this to show additional content for certain user groups on pages (albeit not for money). However, I can't seem to get the line
$groups =& $member_handler->getGroupsByUser($thisUser->getVar('uid'), true);
to work, since all execution of code stops after that (i.e. everything before that line is written on the screen, but nothing after).

Any suggestions?



430
Mazarin
Re: Blank admin.php on 2.3.2b - no errors - tried all the FAQ fixes
  • 2008/12/24 11:07

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


I'll be sure to upload all my CORRECT translations there ;)

Issue solved - Case closed




TopTop
« 1 ... 40 41 42 (43) 44 »



Login

Who's Online

53 user(s) are online (29 user(s) are browsing Support Forums)


Members: 0


Guests: 53


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits