Skip to content

Instantly share code, notes, and snippets.

@collegeman
Created January 20, 2011 20:03
Show Gist options
  • Save collegeman/788537 to your computer and use it in GitHub Desktop.
Save collegeman/788537 to your computer and use it in GitHub Desktop.
<?php
public function calcLevel($new_pts, $old_pts) {
$cur_pts = Member::getPoints($this->member_id, $old_pts);
if (!is_numeric($cur_pts)) {
$cur_pts = 0;
// sometimes we use $cur_pts = is_numeric($cur_pts) ? $cur_pts : 0;
}
if ($new_lev->level_id > $cur_lev) {
$this->new_lev = $new_lev->level_id;
$this->log("Found new level");
return $new_lev->level_id;
} else if (1 == 2) {
// do something
} else {
// do something else
}
$this->new_lev = 0;
return 0;
}
?>
<form action="<?php echo linkTo('admin', 'events'); ?>" id="clear_form" method="post" onSubmit="clearEventForMember();return false">
<input
type="text"
name="event_<?php echo DB_COL_USERNAME; ?>"
id="clear_<?php echo DB_COL_EVENT_NAME; ?>"
value="<?php echo escapeForDisplay($this->member->username); ?>"
/>
</form>
<?php foreach($list as $item) { ?>
<h1><?php echo $item->title ?></h1>
<div><?php echo $item->excerpt ?></div>
<?php if ($item->closed == 1) { ?>
<span>This item is closed.</span>
<?php } else { ?>
<span>This item is open!</span>
<?php } ?>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment