292271
ackbarr
Re: Global variable for Xoops group?

rather than calling $xoopsUser->getGroups() for each iteration of the for loop, I would store the group array into a local variable first. Other than that, the code should work fine.



292272
braddk
Global variable for Xoops group?
  • 2003/8/6 22:41

  • braddk

  • Just popping in

  • Posts: 2

  • Since: 2003/7/22


Is there a global variable for groups in Xoops?

I have some content that I want to prevent users not within specific groups from looking at. ALthough WFSections or something like that is an option, to make URLs simpler, as well as more control, I would rather force authentication based upon a callable variable.

I am able to require that the user logs in to see static content, per the following thread.

I would think that it'd be an easy call to a global variable. I have found the following call in ./includes/common.php. Presumably this is an array:
Quote:
$xoopsUser->getGroups()


If this is the case, than i think the code would be something like this:
Quote:

global $xoopsUser;
foreach ($xoopsUser->getGroups() as $group) {
if (in_array(1, $group) //or whatever the groupid is
//display content
else
//redirect to user.php
}


What do you all think?

edit: I had in_array variables backwards.



292273
watar
Looking for latest version of XP-weather
  • 2003/8/6 19:43

  • watar

  • Just popping in

  • Posts: 12

  • Since: 2002/2/7 8


anyone got a download link? the on downloads here doesn't seem to work :(



292274
brewmeister
Re: PHPrecipebook

Very cool! I would definately like to see this mod



292275
Draven
Re: PHPrecipebook
  • 2003/8/6 14:04

  • Draven

  • Module Developer

  • Posts: 337

  • Since: 2003/5/28


I'm willing to help out. Infact, I was looking to port this myself, nice to see someones already done the hard work. ;)

I want to take it a step further though. I want to include a nutirtional database. I already have the DB with food items and nutritional values, just a matter of hacking it in. This way we get more of a allrecipes.com style recipe book where nutirtional values are given for each recipe included.

If you're interested contact me - draven at gaining-mass.com



292276
hsalazar
Re: Override default table setting in style.css file
  • 2003/8/6 0:14

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


VI_Knight:

Here's what I think might be happening:

Your custom table has style declarations but no id settings. What styles will every TD use? It depends on the location of the table.

Let me be more specific. In the default theme.html, all the center content is within a TD, but it's not any TD: it's a TD with an id="centercolumn", and this means that in the absence of specific declarations, every TD inside it will inherit the one declared as td#centercolumn in the stylesheet.

That's why the different blocks in the theme have their own ids: you might define all of them different, if so you wanted. As it is, most of them have the same styles applied.

The logic within theme.html is easy to follow. Inside the TD with id="centercolumn" there's a table holding all the content in this way:

TD with id=centercolumn
--TABLE
----TR <== This is the first line
------TD with id=centerCcolumn, 2 cols wide
------ Content: blocks defined as center center
------/TD
----/TR

----TR <==This is the second line
------TD with id=centerLcolumn, 1 column wide
------ Content: blocks defined as center left
------/TD
------TD with id=centerRcolumn, 1 column wide
------ Content: blocks defined as center right
------/TD
----/TR
--/TABLE

--DIV with id=content
---- Content: the start page module's main content
--/DIV
etc.

The point to consider here is that every TD has an id, so you can style them as you wish. If you want a table with a different style,perhaps you should define your selectors accordingly.

Let's assume you want a table called custom. Call it with a declaration that includes id="custom" and in the stylesheet make a selector like table.custom { whaterver }. Do the same for the columns of the table: i.e., call them using < td id="customtd1"...>... and make selector like td.customtd1 { ... }...

Another advantage of doing this is the possibility of leaving out of the HTML all the styling code. Put it in the stylesheet, and this will your HTML maintenance mucho more easy.

I think this should work. Please help us posted.

Cheers.



292277
Hober
Re: X2 NewBB: QuickReply Form
  • 2003/8/5 22:14

  • Hober

  • Just popping in

  • Posts: 40

  • Since: 2003/6/13


Quote:

bozzy wrote:
Your code gives me parse errors, something about expecting a , or ; on line 442 or something. And what's with those weird symbols?

I think the symbols are russian...



292278
VI_Knight
Re: Override default table setting in style.css file
  • 2003/8/5 22:00

  • VI_Knight

  • Just popping in

  • Posts: 15

  • Since: 2002/11/16


i am using the default templates for my theme so i am not altering the templates at all. I have mad changes to teh stylesheet to suit the theme that i am designing. Changing the information in the stylesheet and getting it to basically look the way i want is not a problem. However, there are some tables taht i want to alook dirfferently and no matter how i change the options in the tags it does not override the stylesheet. I thought that any specials settings placed in the <table> tags in your html or php cose would override the stylesheet settingsb tut his is not happening.

here is the sample of part of my code and the problem I am having.

<table border="1" cellpadding="0" cellspacing="0" style="border:3px double #00aa99; border-collapse: collapse" width=449 bgcolor="#4E7F81" bordercolordark="#660000" bordercolorlight="#996600">
<tr>
<td width="149"> <img border="0" src="images/hands.jpg" width="281" height="223"></td>
<td width="300" bgcolor="#4E7F81" align="center">
<b><font face="Arial, Book Antiqua, Times New Roman, Times" size="3" color="#ffffff">
Weddings<br>
Graduations<br>
Proms<br>
Parties<br>
Portfolios <br>
Portraiture<br>
Landscaping<br>
Corporate</font></b>
</td>
</tr>
</table>


The problem I am having is that I am trying to get that text to be vertically aligned in the cell. No matter where I put the valign statement it does not work. I tried putting it in the <table> tag in the <tr> tag and the <td> tag and none of them worked. The code by works just fine in a browser by itself but when I add it to my module the formatting is off. The width of the table is also conforming to the 100% specified in the style sheet for the default table settings instead of the 449 that is specified in the tag.

When I alter the stylesheet for the default table in the style.css file to match what I want, it works but it also affects all the other tables. So what i am trying to do is to have taht one section be customized the way i ant it separate from the stylesheet and I m having a hard time getting that accomplished since the tag codes are not overriding the stylesheet.

If you need any more information let me know



292279
azeini
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/8/5 19:37

  • azeini

  • Just popping in

  • Posts: 19

  • Since: 2003/7/23


Hi Chado,

This is a great hack.

Greetings.



292280
Daigoro
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/8/5 17:52

  • Daigoro

  • Quite a regular

  • Posts: 223

  • Since: 2003/7/3 2


Finaly I figured out where the site name of the titleline was inserted into the site. Just as with the Slogan, it's in the header.php file.

The title line is divided into two parts:
The first part is the site name, set using the admin->preferances->general settings form.
The second part is a slogan which changes for each module you enter - and for the startpage is is set in same place as the site name.

In a previous posting in this thread, I explained the four placed I changed to change the slogan. I at the time that two of the four changes would cover the site name and the other two would cover the slogan - not so!

In order to change the site name, I replaced the following line
$xoopsTpl->assign(array('xoops_theme' => $xoopsConfig['theme_set'], 'xoops_imageurl' => XOOPS_URL.'/themes/'.$xoopsConfig['theme_set'].'/''xoops_themecss'=> xoops_getcss($xoopsConfig['theme_set']), 'xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES), 'xoops_sitename' => $xoopsConfig['sitename'], 'xoops_slogan' => $xoopsConfig['slogan']));


...with the following lines

$myts =& MyTextSanitizer::getInstance();
$xoopsTpl->assign(array('xoops_theme' => $xoopsConfig['theme_set'], 'xoops_imageurl' => XOOPS_URL.'/themes/'.$xoopsConfig['theme_set'].'/''xoops_themecss'=> xoops_getcss($xoopsConfig['theme_set']), 'xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES), 'xoops_sitename' => $myts->makeTboxData4Show($xoopsConfig['sitename']), 'xoops_slogan' => $xoopsConfig['slogan']));


and voila, the browsertitle is multilangual.

(Phew - finally I found it








Login

Who's Online

245 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 245


more...

Donat-O-Meter

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

Latest GitHub Commits