Exemplo n.º 1
0
 * For questions, help, comments, discussion, etc. please visit
 * https://github.com/CyberspaceNetworks/CoreSystem
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 */
?>

<div class="module_definition_list">
<dl>
<?php 
if (count($links) > 0) {
    for ($i = 0; $i < count($links); $i++) {
        $date = content_date($links[$i]['created']);
        $comment = $links[$i]['comment'];
        $comment = _out(chop_string($comment, 48));
        $post_title = $links[$i]['post_title'];
        $post_title = _out(chop_string($post_title, 18));
        $author = $links[$i]['name'];
        $author_id = $links[$i]['user_id'];
        $comment = str_replace('<br />', ' ', $comment);
        ?>

          <dt>
           <a href="<?php 
        echo PA::$url . PA_ROUTE_CONTENT . "/cid=" . $links[$i]["content_id"];
        ?>
"><?php 
        echo $post_title;
        ?>
</a>
           <br />
           <span><?php 
<input type="hidden" name="op" value="<?php 
echo $op;
?>
" />
<input type="hidden" name="group_id" value="<?php 
echo $mod->gid;
?>
"/>
<?php 
echo $mod->dynFields->hidden("name");
?>

<?php 
if (@$mod->err) {
    echo '<div class="error">';
    echo _out($mod->err);
    echo '</div>';
}
$type = $mod->dynFields->getVal('type');
if (empty($type)) {
    // $mod->dynFields->select(__("Entity Type"), 'type', $mod->selectTypes);
} else {
    $mod->dynFields->hidden("type");
    ?>
      <div class="field">
        <h4><label><?php 
    echo __("Entity Type");
    ?>
</label></h4>
        <div class="center">
        <?php 
Exemplo n.º 3
0
            <?php 
$links_count = count($links);
if (!empty($links_count)) {
    for ($counter = 0; $counter < $links_count && $counter < $limit; $counter++) {
        ?>
        
                    <li class="list-group-item">
                        <a href="<?php 
        echo PA::$url . PA_ROUTE_CONTENT;
        ?>
/cid=<?php 
        echo $links[$counter]['content_id'];
        ?>
">
                            <?php 
        echo _out($links[$counter]['title']);
        ?>
                        </a>
                        <span>
                            <?php 
        echo content_date($links[$counter]['changed']);
        ?>
                        </span>  
                    </li>   
                    <?php 
    }
} else {
    echo '<li class="list-group-item">' . sprintf(__('No contents in blog.  <a href="%s">Click here to make a post</a>!'), PA::$url . "/" . FILE_POST_CONTENT . $gidQuery) . '</li>';
}
?>
Exemplo n.º 4
0
function uihelper_generate_center_content_permalink($cid, $show = 0)
{
    global $app;
    $image_media_gallery = FALSE;
    $back_page = PA::$url . $app->current_route;
    $content = CNContent::load_content((int) $cid, (int) PA::$login_uid);
    // filter content fields for output
    $content->title = _out($content->title);
    $content->body = _out($content->body);
    if (strstr($back_page, PA_ROUTE_CONTENT) || strstr($back_page, PA_ROUTE_PERMALINK)) {
        if ($content->parent_collection_id > 0) {
            $collection = ContentCollection::load_collection((int) $content->parent_collection_id, PA::$login_uid);
            if ($collection->type == GROUP_COLLECTION_TYPE) {
                $back_page = PA::$url . PA_ROUTE_GROUP . "/gid=" . $content->parent_collection_id;
            } else {
                $back_page = PA::$url . PA_ROUTE_MEDIA_GALLEY_IMAGES . "/uid=" . $content->author_id;
            }
            // IF permalink content is a group content redirect to group homepage
        } else {
            //if coming from permalink page then redirect to user page
            $back_page = PA::$url . PA_ROUTE_USER_PRIVATE;
        }
    }
    $moderateduser = Group::is_admin((int) $content->parent_collection_id, (int) PA::$login_uid) ? 1 : 0;
    $back_page = urlencode($back_page);
    if (!$content->is_html) {
        $content->body = nl2br($content->body);
    }
    $media_gallery_content = NULL;
    $media_gallery_content = in_array(trim($content->type), array('Image', 'Audio', 'Video'));
    $editable = PA::$login_uid == $content->author_id || $moderateduser;
    $comments = Comment::get_comment_for_content($cid, '', 'ASC');
    $number_of_comments = count($comments);
    $content->no_of_comments = $number_of_comments;
    $trackback = CNContent::get_trackbacks_for_content($cid);
    $number_of_trackbacks = count($trackback);
    $content->no_of_trackbacks = $number_of_trackbacks;
    $content->trackback_url = PA::$url . "/pa_trackback.php?cid=" . $cid;
    $content_user = new User();
    $content_user->load((int) $content->author_id);
    $content->create_time = PA::date($content->changed, 'long');
    // date("l, F d, Y", $content->changed);
    $tags = Tag::load_tags_for_content($cid);
    if ($tags) {
        $t = array();
        for ($i = 0; $i < count($tags); $i++) {
            $name = _out($tags[$i]['name']);
            $uid = PA::$login_uid;
            $url = PA::$url . '/' . FILE_TAG_SEARCH . '?name_string=content_tag&keyword=' . $tags[$i]["name"];
            $t[] = "<a href={$url}>" . $name . "</a>";
        }
        $tag_string = "<b>Tags : </b>" . implode(", ", $t);
    } else {
        $tag_string = "";
    }
    $content->tag_entry = $tag_string;
    if (property_exists($content, 'sbname')) {
        if (substr($content->sbname, 0, 5) == 'event') {
            $content->type = 'SBEvent';
        } elseif (substr($content->sbname, 0, 6) == 'review') {
            $content->type = 'Review';
        } elseif (substr($content->sbname, 0, 11) == 'media/audio') {
            $content->type = 'Audio';
        } elseif (substr($content->sbname, 0, 11) == 'media/video') {
            $content->type = 'Video';
        } elseif (substr($content->sbname, 0, 11) == 'media/image') {
            $content->type = 'Image';
        } elseif (substr($content->sbname, 0, 14) == 'showcase/group') {
            $content->type = 'GroupShowCase';
        } elseif (substr($content->sbname, 0, 15) == 'showcase/person') {
            $content->type = 'PersonShowCase';
        }
    }
    // replace magic strings
    $content->replace_percent_strings(PA::$url);
    $type = $content->type;
    $type = $type . 'Permalink';
    // comments
    $comments_list_tpl = new Template(CURRENT_THEME_FSPATH . "/cncontent_comments.php");
    $comments_list_tpl->set('current_theme_path', PA::$theme_url);
    $comments_list_tpl->set('comments', $comments);
    $comments_list_tpl->set('author_id', $content->author_id);
    // Setting the variable for the abuse form ...
    $comments_list = $comments_list_tpl->fetch();
    //comment form
    $cnform_comment_tpl = new Template(CURRENT_THEME_FSPATH . "/cnform_comment.php");
    $cnform_comment_tpl->set('current_theme_path', PA::$theme_url);
    if (isset(PA::$login_uid)) {
        $user = new User();
        $user->load((int) PA::$login_uid);
        $login_name = $user->login_name;
        $cnform_comment_tpl->set('name', $login_name);
        $cnform_comment_tpl->set('login_name', $user->login_name);
    }
    $cnform_comment_tpl->set('cid', $cid);
    if ($content->parent_collection_id > 0) {
        $cnform_comment_tpl->set('ccid', $content->parent_collection_id);
    }
    // abuse form
    $cnform_abuse_tpl = new Template(CURRENT_THEME_FSPATH . "/cnform_abuse.php");
    /* Permalink and edit links for content */
    if ($content->parent_collection_id != -1) {
        $perma_link = PA::$url . PA_ROUTE_PERMALINK . "/cid=" . $content->content_id . '&ccid=' . $content->parent_collection_id;
    } else {
        $perma_link = PA::$url . PA_ROUTE_PERMALINK . "/cid=" . $content->content_id;
    }
    $params = array('permissions' => 'edit_content', 'uid' => PA::$login_uid, 'cid' => $content->content_id);
    if (PermissionsHandler::can_user(PA::$login_uid, $params)) {
        if ($media_gallery_content) {
            $edit_link = PA::$url . '/edit_media.php?cid=' . $content->content_id;
        } else {
            $edit_link = PA::$url . "/cncontent_blog.php?cid=" . $content->content_id;
        }
        $delete_link = PA::$url . PA_ROUTE_CONTENT . "?action=deleteContent&cid=" . $content->content_id . '&amp;back_page=' . $back_page;
        // handle Event separately
        if ($type == "EventPermalink") {
            $edit_link = PA::$url . '/calendar.php?cid=' . $content->content_id;
            $delete_link = $edit_link . "&delete=1" . '&amp;back_page=' . $back_page;
        }
    } else {
        $edit_link = $delete_link = NULL;
    }
    $user_link = PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $content->author_id;
    /* Code for Approval and Denial links for a content */
    if ($moderateduser && $content->is_active == 2) {
        $approval_link = PA::$url . PA_ROUTE_PERMALINK . '/cid=' . $content->content_id . '&ccid=' . $content->parent_collection_id . '&apv=1';
        $denial_link = PA::$url . PA_ROUTE_PERMALINK . '/cid=' . $content->content_id . '&ccid=' . $content->parent_collection_id . '&dny=1';
    } else {
        $approval_link = $denial_link = NULL;
    }
    // Show comments form to logged in users, only if comments enabled.
    global $comments_disabled;
    // fix by Z.Hron; if group content - only members of group can comment it
    $can_user_comment = true;
    if (isset($_GET['gid']) && isset(PA::$login_uid)) {
        $can_user_comment = Group::member_exists((int) $_GET['gid'], PA::$login_uid);
    }
    if (!$comments_disabled && !empty(PA::$login_uid) && $can_user_comment) {
        $cnform_comment = $cnform_comment_tpl->fetch();
        $cnform_abuse = $cnform_abuse_tpl->fetch();
    } else {
        $cnform_comment = $cnform_abuse = NULL;
    }
    if (getShadowedPath(CURRENT_THEME_FSPATH . "/{$type}.php")) {
        $middle_content = new Template(getShadowedPath(CURRENT_THEME_FSPATH . "/{$type}.php"));
        $middle_content->set_object('contents', $content);
        $middle_content->set('editable', $editable);
        $middle_content->set('picture_name', $content_user->picture);
        //  to set picture name for diplaying in contets
        $middle_content->set('user_id', $content_user->user_id);
        $middle_content->set('user_name', $content_user->first_name . ' ' . $content_user->last_name);
        $middle_content->set('current_theme_path', PA::$theme_url);
        $middle_content->set('back_page', $back_page);
        $middle_content->set('comments', $comments_list);
        $middle_content->set('cnform_comment', $cnform_comment);
        $middle_content->set('cnform_abuse', $cnform_abuse);
        $middle_content->set('media_gallery_content', $media_gallery_content);
        if ($show == 1) {
            $middle_content->set('show', $show);
        }
        $middle_content->set('permalink', $perma_link);
        $middle_content->set('edit_link', $edit_link);
        $middle_content->set('approval_link', $approval_link);
        $middle_content->set('denial_link', $denial_link);
        $middle_content->set('delete_link', $delete_link);
        $middle_content->set('user_link', $user_link);
        $return_content = $middle_content->fetch();
    } else {
        $return_content = '<p>Content does not have a display template.</p><p>Create a ' . $type . '.php file to display this content type.</p>';
    }
    return $return_content;
}
require_once "api/Tag/Tag.php";
require_once "api/Comment/Comment.php";
require_once "api/Group/Group.php";
require_once "api/Category/Category.php";
require_once "api/Network/Network.php";
require_once "web/includes/functions/user_page_functions.php";
$header = 'header_user.tpl';
// by default we are setting header as user's header
$media_gallery = 'homepage';
/**
  when collection type is not a Group
*/
$setting_data = ModuleSetting::load_setting(PAGE_PERMALINK, $uid);
$content = Content::load_content((int) $_REQUEST['cid'], (int) PA::$login_uid);
// apply output filtering
$content->title = _out($content->title);
$author = new User();
$author->load((int) $content->author_id);
$is_group_content = FALSE;
/**
   If Collection Type is a Group than left and right module will be the same as Group page
*/
$gid = @$_REQUEST['ccid'];
$content_id = @$_REQUEST['cid'];
$error_message = '';
$authorized_users = array($content->author_id, PA::$network_info->owner_id);
$extra = unserialize(PA::$network_info->extra);
if (@$extra['network_content_moderation'] == NET_YES && Network::item_exists_in_moderation($content_id, $content->parent_collection_id, 'content') && !in_array(PA::$login_uid, $authorized_users)) {
    $error_message = 1001;
}
if ($content->parent_collection_id != -1) {
Exemplo n.º 6
0
function unsolclic_kamikaze($dev)
{
    $version = "1.0";
    $loc = node_load(array('nid' => $dev->nid));
    $zone = node_load(array('nid' => $loc->zone_id));
    $kamikaze_dir = drupal_get_path('module', 'guifi') . '/firmware/kamikaze/';
    if ($dev->radios[0]['mode'] == 'ap') {
        switch ($dev->variable['model_id']) {
            case "1":
            case "15":
            case "16":
            case "17":
            case "18":
                // WRT54Gv1-4, WHR-HP-G54, WHR-G54S (BUFFALO), WRT54GL, WRT54GSv1-2, WRT54GSv4
                include_once '' . $kamikaze_dir . 'broadcom/kamikaze_ap.inc.php';
                break;
            case "25":
            case "26":
            case "32":
            case "33":
            case "34":
            case "35":
            case "36":
            case "37":
                // NanoStationX, LiteStationX, NanoStation LocoX, Bullet
                include_once '' . $kamikaze_dir . 'atheros/kamikaze_ap.inc.php';
                break;
            case "39":
                // Avila GW2348-4
                include_once '' . $kamikaze_dir . 'ixp4xx/kamikaze_ap.inc.php';
                break;
            case "38":
                // RouterStation
                include_once '' . $kamikaze_dir . 'ar71xx/kamikaze_ap.inc.php';
                break;
            default:
                _outln_comment('model id not supported');
                exit;
        }
    }
    if ($dev->radios[0]['mode'] == 'client') {
        switch ($dev->variable['model_id']) {
            case "1":
            case "15":
            case "16":
            case "17":
            case "18":
                // WRT54Gv1-4, WHR-HP-G54, WHR-G54S (BUFFALO), WRT54GL, WRT54GSv1-2, WRT54GSv4
                include_once '' . $kamikaze_dir . 'broadcom/kamikaze_client.inc.php';
                break;
            case "25":
            case "26":
            case "32":
            case "33":
            case "34":
            case "35":
            case "36":
            case "37":
                // NanoStationX, LiteStationX, NanoStation LocoX, Bullet
                include_once '' . $kamikaze_dir . 'atheros/kamikaze_client.inc.php';
                break;
            default:
                _outln_comment('model id not supported');
                exit;
        }
    }
    function openwrt_out_file($txt, $file)
    {
        global $otype;
        if ($otype == 'html') {
            print '<pre>cat > ' . $file . ' << EOF ' . $txt;
            print 'EOF</pre>';
        } else {
            print 'echo "' . $txt . '" > ' . $file;
        }
    }
    function guifi_kamikaze_common_files($dev, $zone)
    {
        list($ntp1, $ntp2) = explode(' ', guifi_get_ntp($zone, 2));
        $ntp[] .= $ntp1;
        $ntp[] .= $ntp2;
        //FILE NTP
        _outln_comment();
        _outln_comment();
        _outln_comment(t('NTPClient Settings'));
        print '<pre>';
        print 'COUNTER=0
while [  $COUNTER -lt 4 ]; do
 uci delete ntpclient.@ntpserver[0] > /dev/null 2>&1
  let COUNTER=COUNTER+1 
done
';
        print 'uci add ntpclient ntpserver
uci set ntpclient.@ntpserver[0]=ntpserver
uci set ntpclient.@ntpserver[0].hostname=' . $ntp1 . '
uci set ntpclient.@ntpserver[0].port=123
uci add ntpclient ntpserver
uci set ntpclient.@ntpserver[1]=ntpserver
uci set ntpclient.@ntpserver[1].hostname=' . $ntp2 . '
uci set ntpclient.@ntpserver[1].port=123
uci add ntpclient ntpserver
uci set ntpclient.@ntpserver[2]=ntpserver
uci set ntpclient.@ntpserver[2].hostname=1.openwrt.pool.ntp.org
uci set ntpclient.@ntpserver[2].port=123
uci set ntpclient.@ntpclient[0]=ntpclient
uci set ntpclient.@ntpclient[0].interval=60
uci set ntpclient.@ntpdrift[0]=ntpdrift
uci set ntpclient.@ntpdrift[0].freq=0
';
        print 'sleep 1</pre>';
        //FILE SYSTEM
        _outln_comment();
        _outln_comment();
        _outln_comment(t('System Settings'));
        print '<pre>';
        print 'uci set system.@system[0]=system
uci set system.@system[0].hostname=' . $dev->nick . '
uci set system.@system[0].zonename=Europe/Andorra
uci set system.@system[0].timezone=CET-1CEST,M3.5.0,M10.5.0/3
uci delete system.@button[0]
uci delete system.@button[1]
uci add system button
uci set system.@button[0]=button
uci set system.@button[0].button=reset
uci set system.@button[0].action=released
uci set system.@button[0].handler="logger reboot"
uci set system.@button[0].min=0
uci set system.@button[0].max=4
uci add system button
uci set system.@button[1]=button
uci set system.@button[1].button=reset
uci set system.@button[1].action=released
uci set system.@button[1].handler="logger factory default"
uci set system.@button[1].min=5
uci set system.@button[1].max=30
';
        print 'sleep 1</pre>';
        _outln_comment();
        _outln_comment();
        _outln_comment(t('SNMP Settings'));
        $loc = node_load(array('nid' => $dev->nid));
        print '<pre>';
        print 'uci set snmpd.@system[0]=system
uci set snmpd.@system[0].sysLocation=' . $loc->nick . '
uci set snmpd.@system[0].sysContact=' . $loc->notification . '
uci set snmpd.@system[0].sysName=guifi.net
uci set snmpd.@system[0].sysDescr="Xarxa Oberta, Lliure i Neutral"
';
        print 'sleep 1</pre>';
        _outln_comment();
        _outln_comment();
        _outln_comment(t('LLDP Settings'));
        $loc = node_load(array('nid' => $dev->nid));
        print '<pre>';
        print 'uci set lldpd.config=lldpd
uci set lldpd.config.enable_cdp=1
uci set lldpd.config.enable_fdp=1
uci set lldpd.config.enable_sonmp=1
uci set lldpd.config.enable_edp=1
uci set lldpd.config.lldp_class=4
uci set lldpd.config.lldp_location=2:ES:6:' . $loc->nick . ':3:guifi.net:19:' . $dev->id . '
';
        print 'sleep 1</pre>';
        //FILE PASSWD
        $file_pass = '******';
        _outln_comment();
        _outln_comment();
        _outln_comment(t('File /etc/passwd'));
        openwrt_out_file($file_pass, '/etc/passwd');
        print '<pre>sleep 1</pre>
';
    }
    switch ($dev->variable['model_id']) {
        case "1":
            // WRT54Gv1-4
        // WRT54Gv1-4
        case "15":
            // WHR-HP-G54, WHR-G54S (BUFFALO)
        // WHR-HP-G54, WHR-G54S (BUFFALO)
        case "16":
            // WRT54GL
            $firmware_tftp = 'broadcom/openwrt-wrt54g-squashfs.bin';
            $firmware = 'broadcom/openwrt-brcm-2.4-squashfs.trx';
            break;
        case "17":
            // WRT54GSv1-2
            $firmware_tftp = 'broadcom/openwrt-wrt54gs-squashfs.bin';
            $firmware = 'broadcom/openwrt-brcm-2.4-squashfs.trx';
            break;
        case "18":
            // WRT54GSv4
            $firmware_tftp = 'broadcom/openwrt-wrt54gs_v4-squashfs.bin';
            $firmware = 'broadcom/openwrt-brcm-2.4-squashfs.trx';
            break;
        case "25":
            // NanoStation2
        // NanoStation2
        case "34":
            // NanoStationLoco2
        // NanoStationLoco2
        case "36":
            // Bullet2
            $firmware_tftp = 'atheros/openwrt-ns2-squashfs.bin';
            $firmware = 'atheros/openwrt-ns2-squashfs.bin';
            break;
        case "26":
            // NanoStation5
        // NanoStation5
        case "35":
            // NanoStationLoco5
        // NanoStationLoco5
        case "37":
            // Bullet5
            $firmware_tftp = 'atheros/openwrt-ns5-squashfs.bin';
            $firmware = 'atheros/openwrt-ns5-squashfs.bin';
            break;
        case "38":
            // RouterStation
            $firmware_tftp = 'ar7xx/openwrt-ar71xx-ubnt-rs-squashfs.bin';
            $firmware = 'ar7xx/openwrt-ar71xx-ubnt-rs-squashfs.bin';
            break;
    }
    $model = db_fetch_object(db_query("\n      SELECT *\n      FROM {guifi_model_specs}\n      WHERE mid=%d", $dev->variable['model_id']));
    _outln_comment('' . $model->model . '');
    _outln_comment(' radio:     ' . $dev->id . '-' . $dev->nick);
    _outln_comment();
    _outln_comment('unsolclic version: ' . $version);
    _outln_comment();
    _outln_comment(t('TFTP method:'));
    if ($dev->radios[0]['mode'] == 'ap') {
        _outln_comment(t('<a href="' . base_path() . 'files/openwrt/ap/' . $firmware_tftp . '"> Click here to download firmware OpenWRT Kamikaze file: ' . $firmware_tftp . '.</a>'));
    } else {
        _outln_comment(t('<a href="' . base_path() . 'files/openwrt/client/' . $firmware_tftp . '"> Click here to download firmware OpenWRT Kamikaze file: ' . $firmware_tftp . '.</a>'));
    }
    _outln_comment();
    _outln_comment(t('Web Browser method:'));
    if ($dev->radios[0]['mode'] == 'ap') {
        _outln_comment(t('<a href="' . base_path() . 'files/openwrt/ap/' . $firmware . '"> Click here to download firmware OpenWRT Kamikaze file: ' . $firmware . '.</a>'));
    } else {
        _outln_comment(t('<a href="' . base_path() . 'files/openwrt/client/' . $firmware . '"> Click here to download firmware OpenWRT Kamikaze file: ' . $firmware . '.</a>'));
    }
    _outln_comment(t('Put the mouse cursor over the link. Right click the link and select "Save Link/Target As..." to save to your Desktop.'));
    _outln_comment();
    _out();
    // print files
    guifi_kamikaze_files($dev, $zone);
    guifi_kamikaze_common_files($dev, $zone);
    _outln_comment();
    _outln_comment(t('end of script and reboot'));
    print '<pre>';
    print 'uci commit
reboot';
    print '</pre>';
}
* @license http://bit.ly/aVWqRV PayAsYouGo License
* @copyright Copyright (c) 2010 Broadband Mechanics
* @package PeopleAggregator
*/
?>
<div class="blog" style="overflow:auto;">
<div style="float:left; width:40%;overflow:auto;">
<?php
$atts = $mod->entity->attributes;

if (!empty($atts['logo'])) {
	$img_info = uihelper_resize_img($atts['logo']['value'], 200, 90, "images/default_group.gif", NULL, RESIZE_FIT);
	echo '<img src="'.$img_info['url'].'" alt="Logo" '.$img_info['size_attr'].' style="margin:0;float:none;"/>';
}
if (!empty($atts['slogan'])) {
	echo "<br/><p>"._out($atts['slogan']['value'])."</p>";
}
?>
</div>
<table>
<tr>
	<td colspan="2"><?php
	$type = $mod->entity->entity_type;
	?><a href="<?=PA::$url.PA_ROUTE_FAMILY_DIRECTORY?>"><?=__("Family")?></a></td>
</tr>
<?php
$statesList = PA::getStatesList();
$countryList = PA::getCountryList();
foreach ($mod->profilefields as $i=>$field) {
	if ('logo' == $field['name']) continue;
	if ('slogan' == $field['name']) continue;
    <div class="field_event">
    <b><?= __("Starts") ?></b>:
    <?=PA::datetime($ed['start_time'])?>
    </div>
    <div class="field_event">
    <b><?= __("Ends") ?></b>: <?=PA::datetime($ed['end_time'])?>
    </div>

    
    <div class="field_event">
    <b><?= __("Venue") ?>:</b>:<br />
    <? echo _out($ed['event_venue']); ?>
    </div>
    <div class="field_event">
    <b><?= __("Description") ?>:</b>:<br />
    <? echo _out($ed['event_description']); ?>
    </div>
<? if ($may_edit) { ?>
<div class="button_position">

    <input type="submit" name="edit" value="<?= __("Edit") ?>">


<?php
  if(isset($_REQUEST['gid'])) {
     $on_click = "location.href=location.href.replace(location.search,'?gid=".$_REQUEST['gid']."')";
  } else {
     $on_click = "location.href=location.href.replace(location.search,'')";
  }
?>
    <input type="submit" name="delete" value="Delete Event" onclick="return confirm('<?= __("Are you sure you want to delete this Event?") ?>');<?=$on_click?>"/>
Exemplo n.º 9
0
#
$host = $db->executeGetOne('SELECT `h`.`host`
FROM
	`ast_sipfriends` `s` JOIN
	`users` `u` ON (`u`.`id`=`s`.`_user_id`) JOIN
	`hosts` `h` ON (`h`.`id`=`u`.`host_id`)
WHERE `s`.`name`=\'' . $escaped_ext . '\'');
if (!empty($host)) {
    _out($host);
}
# queue?
#
$host = $db->executeGetOne('SELECT `h`.`host`
FROM
	`ast_queues` `q` JOIN
	`hosts` `h` ON (`h`.`id`=`q`.`_host_id`)
WHERE `q`.`name`=\'' . $escaped_ext . '\'');
if (!empty($host)) {
    _out($host);
}
# conference?
#
$host = $db->executeGetOne('SELECT `h`.`host`
FROM
	`conferences` `c` JOIN
	`hosts` `h` ON (`h`.`id`=`c`.`host_id`)
WHERE `c`.`ext`=\'' . $escaped_ext . '\'');
if (!empty($host)) {
    _out($host);
}
exit;
Exemplo n.º 10
0
 public function month($date, $event_assocs = NULL, $may_edit = false)
 {
     $calendar_url = $this->calendar_url;
     $self_url = $this->self_url;
     $range = Calendar::range($date, 'month');
     $days = Calendar::days($range, $event_assocs);
     $today_ts = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
     $thism_ts = $days[0]['date_ts'];
     // find on which day this month starts
     $first_week_day = date('w', $thism_ts);
     // header with Month and Year
     $html = "<ul class=\"calendar\">\n";
     // calendar|list
     $html .= "<li class=\"calendarcell header\">\n";
     $prevm_ts = mktime(0, 0, 0, date("m", $thism_ts) - 1, 1, date("Y", $thism_ts));
     $nextm_ts = mktime(0, 0, 0, date("m", $thism_ts) + 1, 1, date("Y", $thism_ts));
     $html .= "<a class=\"month-prev\" href=\"{$self_url}&date=" . date("Y-m-d", $prevm_ts) . "\" title=\"" . date("F Y", $prevm_ts) . "\">&lt;</a>";
     $html .= "<a class=\"month-next\" href=\"{$self_url}&date=" . date("Y-m-d", $nextm_ts) . "\" title=\"" . date("F Y", $nextm_ts) . "\">&gt;</a>";
     $html .= date("F Y", $thism_ts);
     $html .= "</li>\n";
     // render dayheaders
     $fd = $this->first_day_of_week;
     $ld = $fd + 7;
     for ($i = $fd; $i < $ld; $i++) {
         if ($i > 6) {
             $d = $i - 7;
         } else {
             $d = $i;
         }
         $html .= "<li class=\"calendarcell dayheader\">\n";
         $html .= $this->week_days[$d];
         $html .= "</li>\n";
     }
     $grid_count = 0;
     // render empty days at start of month if required
     if ($first_week_day < $fd) {
         $ed = 7 - $first_week_day;
     } else {
         $ed = $first_week_day;
     }
     for ($i = $fd; $i < $ed; $i++) {
         $html .= "<li class=\"calendarcell\">&nbsp;</li>\n";
         $grid_count++;
     }
     // render actual days
     $cnt = count($days);
     $last_week_day = 0;
     for ($i = 0; $i < $cnt; $i++) {
         $events = $days[$i]['events'];
         $event_cnt = count($events);
         $html .= "<li class=\"calendarcell";
         // mark today as special
         if ($days[$i]['date_ts'] == $today_ts) {
             $html .= " today";
         }
         if ($event_cnt) {
             $html .= " hasevents";
         } else {
             $html .= " noevents";
         }
         $html .= "\">\n";
         $html .= "<span class=\"daynumber\">";
         $html .= date("d", $days[$i]['date_ts']);
         $html .= "</span>";
         $html .= "<div class=\"hovertip\">";
         // . "$event_cnt Events for "
         // . date("D jS", $days[$i]['date_ts'])
         if ($event_cnt) {
             $html .= "<ul class=\"eventlist\">\n";
             foreach ($events as $n => $assoc) {
                 $html .= "<li>";
                 if ($may_edit) {
                     $html .= "<a href=\"{$calendar_url}&display_event=" . $assoc->event_id . "\">";
                 }
                 $html .= "<b>" . _out($assoc->event_title);
                 $html .= "</b> on ";
                 $html .= $assoc->start_time;
                 if ($may_edit) {
                     $html .= "</a>";
                 }
                 $html .= "</li>\n";
             }
             $html .= "</ul>\n";
         }
         if ($may_edit) {
             // create link
             $html .= "<a class=\"create-event\" href=\"{$calendar_url}&date=" . date("Y-m-d", $days[$i]['date_ts']) . "\">New</a>";
         }
         $html .= "</div>";
         $html .= "</li>\n";
         $grid_count++;
     }
     // render empty days at end of month if required
     for ($i = $grid_count; $i < 42; $i++) {
         $html .= "<li class=\"calendarcell\">&nbsp;</li>\n";
     }
     $html .= "<li class=\"calendarcell header\">";
     if ($may_edit) {
         // edit link
         $html .= "<b><a class=\"goto-edit\" href=\"{$calendar_url}\">Edit</a></b>&nbsp;&nbsp;&nbsp;";
     }
     $html .= "Display as:\n";
     $html .= "<a href=# class=\"list-style\">List</a>";
     $html .= "<a href=# class=\"calendar-style\">Calendar</a>";
     $html .= "</li>\n";
     $html .= "</ul>\n";
     return $html;
 }
Exemplo n.º 11
0
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* The lastest version of Cyberspace Networks CoreSystem can be obtained from:
* http://developer.cyberspace-networks.com/
* For questions, help, comments, discussion, etc. please visit
* https://github.com/CyberspaceNetworks/CoreSystem
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
$size = sizeof($tags_id_name);
?>
<div class="module_browse_tag">
    <?php 
if ($size) {
    $cnt = 1;
    foreach ($tags_id_name as $tag) {
        $url = PA::$url . '/' . FILE_TAG_SEARCH . '?name_string=content_tag&keyword=' . $tag['name'];
        $name = _out(stripslashes(chop_string($tag['name'], 15)));
        ?>
    <a href="<?php 
        echo $url;
        ?>
"><?php 
        echo $name;
        ?>
</a>
    <?php 
        if ($size > $cnt) {
            ?>
    :: 
    <?php 
        }
        ?>
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * The lastest version of Cyberspace Networks CoreSystem can be obtained from:
 * http://developer.cyberspace-networks.com/
 * For questions, help, comments, discussion, etc. please visit
 * https://github.com/CyberspaceNetworks/CoreSystem
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 */
require_once "api/CNPermissions/CNPermissionsHandler.php";
$param_array = array('permissions' => 'view_abuse_report_form');
$total_comments = count($comments);
if ($total_comments) {
    ?>
  <?php 
    foreach ($comments as $comment) {
        // output filtering
        $comment['comment'] = _out($comment['comment']);
        ?>
  <tr valign="top" id='comment_<?php 
        echo $comment['comment_id'];
        ?>
'>
  <td class="author">

      <?php 
        if ($comment['user_id'] == -1) {
            ?>
      <a rel="nofollow" href="<?php 
            echo htmlspecialchars($comment['homepage']);
            ?>
"><?php 
            echo $comment['name'];
 * @copyright Copyright (c) 2000-2014 Cyberspace Networks
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * The lastest version of Cyberspace Networks CoreSystem can be obtained from:
 * http://developer.cyberspace-networks.com/
 * For questions, help, comments, discussion, etc. please visit
 * https://github.com/CyberspaceNetworks/CoreSystem
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 */
if ($mod->edit_permission) {
    ?>
  <div id="user_announcement" class="inplace_edit"  style="margin: 4px" ajaxUrl="<?php 
    echo PA_ROUTE_USER_PUBLIC . '/' . PA::$page_uid . "&module=PersonalAnnouncementModule&action=updateUserAnnouncement";
    ?>
" minHeight="64px" tinyMCE="false">
    <?php 
    echo _out($mod->announcement);
    ?>
  </div>
<?php 
} else {
    ?>
  <p style="margin: 4px">
    <?php 
    echo _out($mod->announcement);
    ?>
  </p> 
<?php 
}
?>
 
Exemplo n.º 14
0
 function guifi_unsolclic_dhcp($dev)
 {
     $dhcp_statics = array();
     $max = explode(".", $dev->ipv4);
     function merge_static($link, &$dhcp_statics, &$max, &$curr)
     {
         if (empty($link['interface'][mac])) {
             $link['interface'][mac] = 'FF:FF:FF:FF:FF:FF';
         }
         $dhcp_statics[] = array($link['interface'][ipv4][ipv4], $link['interface'][mac], guifi_get_hostname($link['interface'][device_id]));
         $curr = explode(".", $link['interface'][ipv4][ipv4]);
         if ($curr[3] > $max[3]) {
             $max[3] = $curr[3];
         }
     }
     $main_ip = guifi_main_ip($dev->id);
     $item = _ipcalc_by_netbits($main_ip[ipv4], $main_ip[maskbits]);
     $max = explode(".", $main_ip[ipv4]);
     // cable links
     if (!empty($dev->interfaces)) {
         foreach ($dev->interfaces as $interface) {
             if (!empty($interface[ipv4])) {
                 foreach ($interface[ipv4] as $ipv4) {
                     if (!empty($ipv4[links])) {
                         foreach ($ipv4[links] as $link) {
                             if ($link['interface'][ipv4][ipv4] != '') {
                                 $item2 = _ipcalc($link['interface'][ipv4][ipv4], $link['interface'][ipv4][netmask]);
                                 if ($item[netid] == $item2[netid]) {
                                     merge_static($link, $dhcp_statics, $max, $cur);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     // ap/client links
     if (!empty($dev->radios)) {
         foreach ($dev->radios as $radio) {
             if (!empty($radio[interfaces])) {
                 foreach ($radio[interfaces] as $interface) {
                     if (!empty($interface[ipv4])) {
                         foreach ($interface[ipv4] as $ipv4) {
                             if (!empty($ipv4[links])) {
                                 foreach ($ipv4[links] as $link) {
                                     if ($link['link_type'] == 'ap/client' and !empty($link['interface'][ipv4][ipv4])) {
                                         merge_static($link, $dhcp_statics, $max, $cur);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     $statics = count($dhcp_statics) - 1;
     $totalstatics = count($dhcp_statics);
     if ($statics == -1) {
         _outln_comment();
         _outln_comment('DHCP');
         _outln_nvram('dhcp_start', $max[3] + 5);
         return;
     }
     _outln_comment();
     _outln_comment('DHCP');
     if ($dev->variable['firmware'] == 'Alchemy') {
         _out_nvram('dhcpd_statics');
         for ($i = 0; $i < $statics; $i++) {
             _out(implode(" ", $dhcp_statics[$i]));
         }
         _out(implode(" ", $dhcp_statics[$statics]), '"');
     }
     if ($dev->variable['firmware'] == 'DD-WRTv23' or $dev->variable['firmware'] == 'DD-guifi') {
         $staticText = "";
         foreach ($dhcp_statics as $static) {
             $staticText .= $static[1] . "=" . $static[2] . "=" . $static[0] . " ";
         }
         _out('nvram set static_leases="' . $staticText, ' "');
         _outln_nvram('static_leasenum', $totalstatics);
     }
     if ($dev->variable['firmware'] == 'Talisman') {
         _out_nvram('dhcp_statics');
         foreach ($dhcp_statics as $static) {
             _out($static[1] . "-" . $static[0] . "-" . $static[2] . " ");
         }
         _out(null, '"');
     }
     _outln_nvram('dhcp_start', $max[3] + 5);
     return;
 }