1
AZNative
piCal recurring (Summer time/Winter time) problem SOLVED and other useful hacks
  • 2004/8/30 6:28

  • AZNative

  • Friend of XOOPS

  • Posts: 8

  • Since: 2004/4/21


Read this and other useful hacks at http://www.peak.ne.jp/xoops/modules/xhnewbb/viewtopic.php?topic_id=271&post_id=1062&order=0&viewmode=flat&pid=0&forum=1#forumpost1062

Lots of stuff to check out and cool hacks, so instead of double-posting it here, check it out at the home of piCal.



2
AZNative
Re: YAXSTR
  • 2004/5/8 23:53

  • AZNative

  • Friend of XOOPS

  • Posts: 8

  • Since: 2004/4/21


Yeah, still working on the graphics. Photoshop guru I am not. Also still evaluating xcGallery and MyAlbum.



3
AZNative
YAXSTR
  • 2004/5/8 22:20

  • AZNative

  • Friend of XOOPS

  • Posts: 8

  • Since: 2004/4/21


Yet Another XOOPS Site To Review...

This is a demo site that I set up so my clients can preview what they are getting.

Feel free to login and check things out. This site has lots of hacks, modificaitons and even some custom modules (kinda). A lot of this stuff is behind the scenes. It has been designed for use within Homeowner Associations (for those of you who know what those are).

http://www.dpsystemsonline.com/cms

Feel free to leave feedback here. It's always good to have additional sets of eyes checking your site for those things that can be easily overlooked by the one who coded it.

And not to brag, but I've created a script that allows me to get one of these sites installed, configured and running in under an hour.





4
AZNative
Re: Is there a way to only allow some registered users to submit news?
  • 2004/5/8 21:56

  • AZNative

  • Friend of XOOPS

  • Posts: 8

  • Since: 2004/4/21


In the xoops_version.php file for news, find these two lines of code:

$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
$modversion['sub'][1]['url'] = "submit.php";


and change it to look like this:

global $xoopsUser;

if(! empty(
$xoopsUser)) {
  
$group $xoopsUser->getGroups();

  if (
in_array(1$group) || in_array(4$group) || in_array(5$group)) {
    
$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
    
$modversion['sub'][1]['url'] = "submit.php";
  }
}


In the code, above, the 1, 4 and 5 refer to groups, so just put whatever groups you want here and only those groups will even see the link.






5
AZNative
Re: Strange Upload Error
  • 2004/5/4 20:24

  • AZNative

  • Friend of XOOPS

  • Posts: 8

  • Since: 2004/4/21


I believe my solution above is the fix. I was just hoping someone else could confirm my findings and verify it. Always good to have more than one set of eyes looking at the code.

Then you can include it in your next build.



6
AZNative
Re: Strange Upload Error
  • 2004/5/4 14:40

  • AZNative

  • Friend of XOOPS

  • Posts: 8

  • Since: 2004/4/21


I think I've come across a bug with the permissions and anonymous users.

You have 3 categories and each of those categories can only be viewed by certain groups:

Category 1 -> Registered Users
Category 2 -> Registered Users
Category 3 -> Anonymous Users

Logout of the system and go to the documents section. All three categories are visible even though only category 3 should be visible.

I looked in the functions.php file and came to the conclusion that the $usersid field being passed into the checkMyDownloadsPermission($groupid, $usersid) function is null. This is because no specific users permission were set for that category, only group permissions were set. This makes sense.

Then, you set the $uid null because the current user is anonymous. This also makes sense.

The problem comes further down, around line 120 in functions.php. There is the following block of code:

for ($i=0$i<count($usersid); $i++) {
   
//echo $usersid[$i];
   
if ($usersid[$i]==$uid) {
      return 
true;
   }
 }

 return 
false;


Since both $userid and $uid are null, this block of code will return true, which indicates that the anonymous user DOES have permission to access the category. Since these two fields will always be null, the anonymous user gets to see all categories. In addition, the $usersid will ALWAYS be null or empty in this case because you can't assign an anonymous user to a category. You can only assign the anonymous group to a category.

I was able to resolve the problem (I need to do some further testing though) by modifying the code of block above to look like this:

for ($i=0$i<count($usersid); $i++) {
   
//echo $usersid[$i];

   // HACK: CODE ADDED
   
if ($uid == null) {
     return 
false;
   }
   
// END HACK

   
if ($usersid[$i]==$uid) {
      return 
true;
   }
 }

 return 
false;


What this hack does it simply return false if we have a null user (anonymous) ensuring that the category is not shown.

I was hoping someone else can verify my findings. Please post here.

Thank you.



7
AZNative
Re: How do you do admin stuff if you hide login boxes??
  • 2004/4/29 5:15

  • AZNative

  • Friend of XOOPS

  • Posts: 8

  • Since: 2004/4/21


Since I didn't want an entire "user menu" or "admin menu" cluttering my already crowded screen, here's what implemented.

Each of my themes have a few menu items across the top of the page. I added the following code to each of my theme.html files so make certain links appear based on who is logged in.

This code will show a link to the Admin Panel if the person who is logged in is indeed an Administrator.

<{if $xoops_isadmin == true}>
 &
nbsp;&bull;&nbsp;
 <
a href="<{$xoops_url}>/admin.php">Admin Panel</a>
<{/if}>


This code takes the name of the user currently logged in and creates a link to that users account information, so they can view or edit their profile.

&nbsp;&bull;&nbsp;
 <
a href="<{$xoops_url}>/user.php"><{$xoops_uname}> Account</a>


Good luck.



8
AZNative
piCal 6.0 Bugs?
  • 2004/4/29 4:53

  • AZNative

  • Friend of XOOPS

  • Posts: 8

  • Since: 2004/4/21


I created a very large SQL script that inserts a bunch of calendar events directly into the database. Here is an example of one of those INSERT statements:

INSERT INTO xoops_pical_event (uid, groupid, summary, sequence, description, transp, admission, class, allday, start, end, event_tz, server_tz, poster_tz)
VALUES (1, 00000, 'Tax Day', 0, 'Tax Day', 1, 1, 'PUBLIC', 1, UNIX_TIMESTAMP('2004-4-15 00:00:00'), UNIX_TIMESTAMP('2004-4-15 23:59:59'), -7, -7, -7);

There are 132 of these statements that insert events throughout the year, in just about every month. All events are "All Day" events. What I notice that for the month of April, the event shows up on the correct day and also the day before. So, if you take the insert statement above for example, the event "Tax Day" will show up on April 15 and April 14. This happens for all events in April and it doesn't matter what year either. When I put the same event for April 15, 2007, the same thing happens.

Also, if I go into the calendar and add the event manually, the same thing occurs, so it appears that it has nothing to do with the SQL statements.

Again, this only happens for the month of April.


Bug number 2:

After inserting all 132 events, I decide to edit one of them. I open up the event and choose the option to "Show as Bar". After I save it, every event that month has a bar, not just the one I checked.

I'll try to do some investigating myself, but there's a lot of code....




TopTop



Login

Who's Online

204 user(s) are online (147 user(s) are browsing Support Forums)


Members: 0


Guests: 204


more...

Donat-O-Meter

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

Latest GitHub Commits