function HookImage_textDownload_progressAddtodownloadquerystring()
{
    if (getval("nooverlay", "") != "") {
        return "&nooverlay=true";
    }
    return false;
}
Пример #2
0
 protected function set_page_info()
 {
     // sett opp side informasjon
     $this->pagei = new pagei(pagei::TOTAL, $this->num_messages, pagei::ACTIVE_GET, "side", pagei::PER_PAGE, $this->per_page);
     $this->limit = $this->pagei->per_page;
     // har vi nye meldinger?
     if ($this->thread->data_rel && $this->thread->data_rel['ir_unread'] > 0) {
         $this->pagei->__construct(pagei::ACTIVE, 1);
         $this->limit = max($this->limit, $this->thread->data_rel['ir_unread']);
     } elseif (isset($_GET['goto'])) {
         $im_id = intval(getval("goto"));
         // forsøk å finn meldingen
         $ant = $this->thread->message_locate($im_id);
         if (!$ant) {
             ess::$b->page->add_message("Fant ingen melding med ID {$im_id}.", "error");
             redirect::handle();
         }
         // finn ut hvilken side vi skal til
         $side = ceil($ant / $this->per_page);
         // gå til korrekt side
         if ($this->pagei->active != $side) {
             redirect::handle("innboks_les?id={$this->thread->id}&goto={$im_id}&side={$side}");
         }
         $this->highlight_im_id = $im_id;
     }
 }
Пример #3
0
function HookResourceconnectViewResourceactions_anonymous()
{
    if (getval("resourceconnect_source", "") == "") {
        return false;
    }
    # Not a ResourceConnect result set.
    global $lang, $title_field, $ref, $baseurl, $search, $offset, $scramble_key, $language, $resource;
    # Generate access key
    $access_key = md5("resourceconnect" . $scramble_key);
    # Formulate resource link (for collections bar)
    $view_url = $baseurl . "/pages/view.php?ref=" . $ref . "&k=" . substr(md5($access_key . $ref), 0, 10) . "&language_set=" . urlencode($language) . "&resourceconnect_source=" . urlencode($baseurl);
    # Add to collections link.
    $url = getval("resourceconnect_source", "") . "/plugins/resourceconnect/pages/add_collection.php?nc=" . time();
    $url .= "&title=" . urlencode(get_data_by_field($ref, $title_field));
    $url .= "&url=" . urlencode($view_url);
    # Add back URL
    $url .= "&back=" . urlencode($baseurl . "/pages/view.php?" . $_SERVER["QUERY_STRING"]);
    # Add images
    if ($resource["has_image"] == 1) {
        $url .= "&thumb=" . urlencode(get_resource_path($ref, false, "col", false, "jpg"));
    } else {
        $url .= "&thumb=" . urlencode($baseurl . "/gfx/" . get_nopreview_icon($resource["resource_type"], $resource["file_extension"], true));
    }
    ?>
	
	<li><a target="collections" href="<?php 
    echo $url;
    ?>
">&gt; <?php 
    echo $lang["action-addtocollection"];
    ?>
</a></li>
	<?php 
}
function HookImage_textDownload_usageAddtodownloadquerystring()
{
    if (getval("nooverlay", "") != "") {
        return "?nooverlay=true";
    }
    return "";
}
function HookResourceConnectCollection_downloadInitialise()
{
    global $inside_plugin;
    if (!isset($inside_plugin)) {
        redirect("plugins/resourceconnect/pages/collection_download.php?collection=" . getval("collection", ""));
    }
}
Пример #6
0
function DisplayThemeBar($theme1)
        {
        global $lang,$flag_new_themes,$contact_sheet,$theme_images,$allow_share,$n,$baseurl;

        # Work out theme name
        $themename=$theme1;
        $theme_display=getval("theme_$n","off");
       
        $themes=get_themes(array($theme1));
        if (count($themes)>0)
                {
                ?>

<div
onclick="
var theme_display=get_cookie('theme_<?php echo $n?>');
if (theme_display=='off'){var toggle_theme_display='on';} else { var toggle_theme_display='off';}
SetCookie('theme_<?php echo $n?>',toggle_theme_display,1000);
jQuery('#themebar_<?php echo htmlspecialchars(str_replace(array("\""," "),"",$themename)) ?>').slideToggle(0.2);


return false;">                
               
	<a href='#'><b><?php echo htmlspecialchars(stripslashes(i18n_get_translated(str_replace("*","",$themename)))) ?></b></a></div>
               
<div id="themebar_<?php echo htmlspecialchars(str_replace(array("\""," "),"",$themename)) ?>" style="display:<?php if ($theme_display == 'off'){echo 'none';} else {echo '';}?>" >
                <?php
                for ($m=0;$m<count($themes);$m++)
                        { ?><br>
                        &nbsp;&nbsp;&nbsp;<a href="<?php echo $baseurl?>/pages/search.php?search=!collection<?php echo $themes[$m]["ref"]?>&bc_from=themes"  title="<?php echo $lang["collectionviewhover"]?>"><?php echo htmlspecialchars(i18n_get_collection_name($themes[$m])) ?></a>
                        <?php
                        }
                ?><br><br></div><?php
                }
        }
Пример #7
0
function HookImage_textTermsBeforeredirectchangeurl()
{
    global $url;
    if (getval("nooverlay", "") != "") {
        return $url . "&nooverlay=true";
    }
    return false;
}
function HookPropose_changesCollection_editSavecollectionAdditionalfields()
{
    global $propose_changes_always_allow;
    if (!$propose_changes_always_allow) {
        $propose_changes = getval("propose_changes", "") != "" ? 1 : 0;
        return "propose_changes='{$propose_changes}',";
    }
    return "";
}
Пример #9
0
 /**
  * Construct
  */
 public function __construct()
 {
     $this->forum = new \Kofradia\Forum\Category(getval("f"));
     $this->forum->require_access();
     $this->forum->add_title();
     ess::$b->page->add_title("Ny forumtråd");
     $this->show();
     $this->forum->load_page();
 }
Пример #10
0
function HookFilterboxAllPreheaderoutput()
{
    if (getval('ajax', '') == '') {
        return;
    }
    ?>
	<script type="text/javascript">
		jQuery(document).ready(showHideFilterboxPanel);
	</script>
	<?php 
}
function HookPropose_changesResource_emailAdditional_email_collection($colrefs, $collectionname, $fromusername, $userlist, $message, $feedback, $access, $expires, $useremail, $from_name, $cc, $themeshare, $themename, $themeurlsuffix, $template, $templatevars)
{
    global $propose_changes_always_allow;
    if (!$propose_changes_always_allow) {
        $propose_changes = getval("propose_changes", "") != "" ? 1 : 0;
        if ($propose_changes) {
            sql_query("update collection set propose_changes=1 where ref in ('{$colrefs}')");
        }
    }
    return true;
}
Пример #12
0
function HookResourceconnectPreviewNextpreviewregeneratekey()
{
    if (getval("resourceconnect_source", "") == "") {
        return false;
    }
    # Not a ResourceConnect result set.
    global $ref, $k, $scramble_key;
    # Create a new key when moving next/back for a given result set.
    $access_key = md5("resourceconnect" . $scramble_key);
    $k = substr(md5($access_key . $ref), 0, 10);
    return $k;
}
Пример #13
0
function HookEmbedvideoViewAfterresourceactions()
{
    global $embedvideo_resourcetype, $ffmpeg_preview_extension, $resource, $ref, $ffmpeg_preview_max_width, $ffmpeg_preview_max_height, $userfixedtheme, $baseurl, $lang;
    if ($resource["resource_type"] != $embedvideo_resourcetype) {
        return false;
    }
    # Not the right type.
    ?>

	<?php 
    # FLV player - plays the FLV file created to preview video resources.
    if (file_exists(get_resource_path($ref, true, "pre", false, $ffmpeg_preview_extension))) {
        $flashpath = get_resource_path($ref, false, "pre", false, $ffmpeg_preview_extension, -1, 1, false, "", -1, false);
    } else {
        $flashpath = get_resource_path($ref, false, "", false, $ffmpeg_preview_extension, -1, 1, false, "", -1, false);
    }
    $flashpath = urlencode($flashpath);
    $thumb = get_resource_path($ref, false, "pre", false, "jpg");
    $thumb = urlencode($thumb);
    # Choose a colour based on the theme.
    # This is quite hacky, and ideally of course this would be CSS based, but the FLV player requires that the colour
    # is passed as a parameter.
    # The default is a neutral grey which should be acceptable for most user generated themes.
    $theme = isset($userfixedtheme) && $userfixedtheme != "" ? $userfixedtheme : getval("colourcss", "greyblu");
    $colour = "505050";
    if ($theme == "greyblu") {
        $colour = "446693";
    }
    ?>
<li><a href="#" onClick="
if (document.getElementById('embedvideo').style.display=='block') {document.getElementById('embedvideo').style.display='none';} else {document.getElementById('embedvideo').style.display='block';}
if (document.getElementById('embedvideo2').style.display=='block') {document.getElementById('embedvideo2').style.display='none';} else {document.getElementById('embedvideo2').style.display='block';}
 return false;">&gt;&nbsp;<?php 
    echo $lang["embed"];
    ?>
</a></li>
<p id="embedvideo2" style="display:none;float:left;padding:10px 0 3px 0;"><?php 
    echo $lang["embed_help"];
    ?>
</p>
<textarea id="embedvideo" style="width:335px;height:200px;display:none;"><?php 
    if (!hook("replaceembedcode")) {
        echo htmlspecialchars('
<object type="application/x-shockwave-flash" data="' . $baseurl . '/lib/flashplayer/player_flv_maxi.swf" width="' . $ffmpeg_preview_max_width . '" height="' . $ffmpeg_preview_max_height . '" class="Picture"><param name="allowFullScreen" value="true" /><param name="movie" value="' . $baseurl . '/lib/flashplayer/player_flv_maxi.swf" /><param name="FlashVars" value="flv=' . $flashpath . '&amp;width=' . $ffmpeg_preview_max_width . '&amp;height=' . $ffmpeg_preview_max_height . '&amp;margin=0&amp;buffer=10&amp;showvolume=1&amp;volume=200&amp;showtime=1&amp;autoplay=1&amp;autoload=0&amp;showfullscreen=1&amp;showstop=1&amp;playercolor=' . $colour . '&startimage=' . $thumb . '" /></object>
');
    }
    // end hook replaceembedcode
    ?>
</textarea>

	<?php 
    return true;
}
Пример #14
0
 /**
  * Construct
  */
 public function __construct()
 {
     $this->forum = new \Kofradia\Forum\Category(getval("id"));
     $this->forum->require_access();
     $this->forum->add_title();
     // slette forumtråder?
     if (isset($_POST['slett_emner']) && $this->forum->fmod) {
         $this->delete_topics();
     }
     // vis forumet
     $this->show_forum();
     $this->forum->load_page();
 }
Пример #15
0
 /**
  * Construct
  */
 public function __construct()
 {
     access::no_guest();
     ess::$b->page->add_title("Anti-bot sjekk");
     // hvilken side vi skal sendes til
     $this->redirect_url = getval("ret");
     if (!$this->redirect_url) {
         $this->redirect_url = ess::$s['relative_path'] . "/";
     }
     // sjekk etter anti-bot
     $name = getval("name");
     $this->antibot = antibot::get($name);
     if (!$this->antibot->data) {
         ess::$b->page->add_message("Anti-bot oppføringen er ikke opprettet.", "error");
         $this->redirect();
     }
     // kuler?
     if ($name == "kuler") {
         // gjennomfør pre-check
         if (!$this->antibot->kuler_precheck()) {
             $this->redirect();
         }
         // sett lave ventetider
         $this->update_delay = 2;
         $this->retry_delay = 2;
     }
     redirect::store("sjekk?name=" . urlencode($this->antibot->name) . '&ret=' . urlencode($this->redirect_url));
     // sjekk om anti-boten ikke krever sjekk
     if (!$this->antibot->is_check_required()) {
         $this->redirect();
     }
     // sjekk for ventetid
     $this->check_wait();
     // hent bildene
     $this->load_images();
     $this->form = \Kofradia\Form::getByDomain("anti-bot", login::$user);
     // utføre sjekk?
     if (isset($_POST['valider']) && isset($this->images) && !$this->wait) {
         $this->check();
     }
     // nye bilder?
     if (isset($_POST['new'])) {
         $this->new_imgs();
     }
     // vis anti-boten
     $this->show();
 }
Пример #16
0
function serveHeader()
{
    global $lang, $username, $pagename, $loginterms, $baseurl, $linkedheaderimgsrc, $allow_password_change, $userfullname, $username, $slimheader, $theme, $responsiveheaderimgsrc;
    if (!empty($linkedheaderimgsrc)) {
        $header_img_src = $linkedheaderimgsrc;
    } else {
        if (!empty($responsiveheaderimgsrc)) {
            $header_img_src = $responsiveheaderimgsrc;
        } else {
            $header_img_src = $baseurl . '/gfx/titles/title.png';
        }
    }
    if (!$slimheader) {
        ?>
        <a href="<?php 
        echo $baseurl;
        ?>
"><img src="<?php 
        echo $baseurl . $header_img_src;
        ?>
" id="HeaderImg" style="display:none;"></img></a>
        
        <?php 
    } else {
        $linkedheaderimgsrc = $header_img_src;
    }
    if (isset($username) && $pagename != "login" && $loginterms == false && getval("k", "") == "") {
        ?>
   
        <div id="HeaderButtons" style="display:none;">
            <a href="#" id="HeaderNav1Click" class="ResponsiveHeaderButton ResourcePanel ResponsiveButton"><span class="rbText"><?php 
        echo $allow_password_change == false ? htmlspecialchars($userfullname == "" ? $username : $userfullname) : $lang["responsive_settings_menu"];
        ?>
 </span><span class="glyph glyph_user"></span></a>
            <a href="#" id="HeaderNav2Click" class="ResponsiveHeaderButton ResourcePanel ResponsiveButton"><span class="rbText"><?php 
        echo $lang["responsive_main_menu"];
        ?>
 </span><span class="glyph glyph_menu"></span></a>
        </div>
        <?php 
    }
    ?>
    </div>
    <?php 
}
Пример #17
0
    /** Initialisering */
    public static function init()
    {
        access::no_guest();
        // oppdatere status?
        if (isset($_POST['load_status'])) {
            self::action_status();
            die;
        }
        ess::$b->page->add_title("Support");
        ess::$b->page->add_css('
td.support_important {
	background-color: #FF0000;
	color: #FFFFFF;
	font-weight: bold;
}
');
        // hva skal vises?
        switch (getval("a")) {
            // vis en henvendelse
            case "show":
                self::action_show();
                break;
                // panelet
            // panelet
            case "panel":
                self::action_panel();
                break;
                // søk
            // søk
            case "search":
                self::action_search();
                break;
                // forsiden
            // forsiden
            case "":
                self::action_main();
                break;
                // ukjent
            // ukjent
            default:
                redirect::handle("");
        }
        ess::$b->page->load();
    }
Пример #18
0
function HookColorthemerAllAdjustcolortheme()
{
    global $storagedir, $storageurl, $baseurl, $userfixedtheme, $defaulttheme, $css_reload_key, $pagename;
    // check if colorthemer theme is set
    if (is_numeric($userfixedtheme)) {
        // check if theme exists yet, else use defaulttheme
        if (file_exists($storagedir . "/colorthemes/" . $userfixedtheme . "/Col-" . $userfixedtheme . ".css")) {
            ?>
		<link href="<?php 
            echo $storageurl;
            ?>
/colorthemes/<?php 
            echo $userfixedtheme;
            ?>
/Col-<?php 
            echo $userfixedtheme;
            ?>
.css?css_reload_key=<?php 
            echo $css_reload_key;
            ?>
" rel="stylesheet" type="text/css" media="screen,projection,print" id="colourcss" />
		<?php 
        } else {
            ?>
			<link href="<?php 
            echo $baseurl;
            ?>
/css/Col-<?php 
            echo getval("colourcss", $defaulttheme);
            ?>
.css?css_reload_key=<?php 
            echo $css_reload_key;
            ?>
" rel="stylesheet" type="text/css" media="screen,projection,print" id="colourcss" />
			<?php 
        }
        return true;
    } else {
        // theme isn't colorthemer_#
        return false;
    }
}
/**
* Generates the CSV content of the metadata for resources passed in the array
*
* @param $resources
* @return string
*/
function generateResourcesMetadataCSV(array $resources)
{
    global $lang;
    $return = '';
    $csv_field_headers = array();
    $resources_fields_data = array();
    foreach ($resources as $resource) {
        foreach (get_resource_field_data($resource['ref'], false, true, -1, getval("k", "") != "") as $field_data) {
            if ($field_data['name'] == '') {
                die('Please check field ID ' . $field_data['ref'] . ' and make sure its "' . $lang['property-shorthand_name'] . '" is set!');
            }
            $csv_field_headers[$field_data['name']] = $field_data['title'];
            $resources_fields_data[$resource['ref']][$field_data['name']] = $field_data['value'];
        }
    }
    $csv_field_headers = array_unique($csv_field_headers);
    // Header
    $return = '"' . $lang['resourceids'] . '","' . implode('","', $csv_field_headers) . "\"\n";
    // Results
    $csv_row = '';
    foreach ($resources_fields_data as $resource_id => $resource_fields) {
        // First column will always be Resource ID
        $csv_row = $resource_id . ',';
        // Field values
        foreach ($csv_field_headers as $column_header => $column_header_title) {
            if (!array_key_exists($column_header, $resource_fields)) {
                $csv_row .= '"",';
                continue;
            }
            foreach ($resource_fields as $field_name => $field_value) {
                if ($column_header == $field_name) {
                    $csv_row .= '"' . tidylist(i18n_get_translated($field_value)) . '",';
                }
            }
        }
        $csv_row .= "\n";
        $return .= $csv_row;
    }
    return $return;
}
function HookMeta_appendAllAfterpluploadfile()
{
    global $meta_append_field_ref, $meta_append_date_format, $ref, $userref;
    $found_meta_append_field = getval("metaappend", false);
    if ($found_meta_append_field && $found_meta_append_field == $meta_append_field_ref && $ref > 0) {
        $result = sql_query("select value from resource_data where resource={$ref} and resource_type_field={$meta_append_field_ref}");
        if (!isset($result[0]['value'])) {
            return;
        }
        $value_string = $result[0]['value'];
        $result = sql_query("select ref from resource where date(creation_date)=curdate() and created_by={$userref}");
        if (!isset($result[0])) {
            $count = 1;
        } else {
            $count = count($result);
        }
        $count_string = str_pad($count, 4, "0", STR_PAD_LEFT);
        $date_string = date($meta_append_date_format);
        $new_value_string = $value_string . $date_string . $count_string;
        update_field($ref, $meta_append_field_ref, $new_value_string);
    }
}
 function save_research_request($ref)
 {
     # Save
     global $baseurl, $email_from, $applicationname, $lang;
     if (getval("delete", "") != "") {
         # Delete this request.
         sql_query("delete from research_request where ref='{$ref}' limit 1");
         return true;
     }
     # Check the status, if changed e-mail the originator
     $oldstatus = sql_value("select status value from research_request where ref='{$ref}'", 0);
     $newstatus = getvalescaped("status", 0);
     $collection = sql_value("select collection value from research_request where ref='{$ref}'", 0);
     $templatevars['url'] = $baseurl . "/?c=" . $collection;
     if ($oldstatus != $newstatus) {
         $email = sql_value("select u.email value from user u,research_request r where u.ref=r.user and r.ref='{$ref}'", "");
         $message = "";
         if ($newstatus == 1) {
             $message = $lang["researchrequestassignedmessage"];
             $subject = $lang["researchrequestassigned"];
             send_mail($email, $applicationname . ": " . $subject, $message, "", "", "emailresearchrequestassigned", $templatevars);
             # Log this
             daily_stat("Assigned research request", 0);
         }
         if ($newstatus == 2) {
             $message = $lang["researchrequestcompletemessage"] . "\n\n" . $lang["clicklinkviewcollection"] . "\n\n" . $templatevars['url'];
             $subject = $lang["researchrequestcomplete"];
             send_mail($email, $applicationname . ": " . $subject, $message, "", "", "emailresearchrequestcomplete", $templatevars);
             # Log this
             daily_stat("Processed research request", 0);
         }
     }
     sql_query("update research_request set status='" . $newstatus . "',assigned_to='" . getvalescaped("assigned_to", 0) . "' where ref='{$ref}'");
     # Copy existing collection
     if (getvalescaped("copyexisting", "") != "" && is_numeric($collection)) {
         sql_query("insert into collection_resource(collection,resource) select '{$collection}',resource from collection_resource where collection='" . getvalescaped("copyexistingref", "") . "' and resource not in (select resource from collection_resource where collection='{$collection}');");
     }
 }
Пример #22
0
function HookFeedbackAllToptoolbaradder()
{
    global $target, $baseurl, $feedback_questions, $feedback_prompt_text, $pagename;
    ?>
<li><a target="<?php 
    echo $target;
    ?>
" href="<?php 
    echo $baseurl;
    ?>
/plugins/feedback/pages/feedback.php">User Survey</a></li>
	
	<?php 
    if ($pagename == "setup" || $pagename == "feedback") {
        return true;
    }
    # Do not appear on the setup page or during giving feedback.
    # Form a check key based on the feedback form, so that form changes prompt a new message.
    # $check=md5(serialize($feedback_questions));
    if (getval("feedback_completed", "") == "") {
        ?>
		<div id="feedback_prompt" style="border:1px solid #BBB;border-bottom-width:3px;border-bottom-color:#bbb;background-color:white;width:300px;height:150px;position:absolute;top:100px;left:300px;text-align:left;padding:10px;color:black;">
		<?php 
        echo $feedback_prompt_text;
        ?>
		
		<div style="text-align:right;">
		<input type="button" value="Yes" onClick="SetCookie('feedback_completed','yes',30);document.location.href='<?php 
        echo $baseurl;
        ?>
/plugins/feedback/pages/feedback.php';">
		<input type="button" value="No" onClick="SetCookie('feedback_completed','yes',30);document.getElementById('feedback_prompt').style.display='none';">
		<input type="button" value="Remind me later" onClick="SetCookie('feedback_completed','yes',0.5);document.getElementById('feedback_prompt').style.display='none';">
		</div>
		</div>
		<?php 
    }
}
Пример #23
0
function Hookyt2rsViewreplacedownloadoptions()
{
    // Replace download options
    global $ref, $yt2rs_field_id, $baseurl_short, $lang;
    $youtube_url = get_data_by_field($ref, $yt2rs_field_id);
    if ($youtube_url !== "" && isValidURL($youtube_url)) {
        ?>
			<table cellpadding="0" cellspacing="0">
				<tr >
					<td>File Information</td>
					<td>File Size </td>
					<td>Options</td>
				</tr>
				<tr class="DownloadDBlend">
					<td><h2>Online Preview</h2><p>Youtube Video</p></td>
					<td>N/A</td>
					<td class="DownloadButton HorizontalWhiteNav"><a href="<?php 
        echo $baseurl_short;
        ?>
pages/resource_request.php?ref=<?php 
        echo urlencode($ref);
        ?>
&k=<?php 
        echo getval("k", "");
        ?>
" onClick="return CentralSpaceLoad(this,true);">
				<?php 
        echo $lang["action-request"];
        ?>
</td>
				</tr>
			</table>
<?php 
        return true;
    } else {
        return false;
    }
}
Пример #24
0
function HookResourceConnectAllInitialise()
{
    # Work out the current affiliate
    global $lang, $language, $resourceconnect_affiliates, $baseurl, $resourceconnect_selected, $resourceconnect_this;
    # Work out which affiliate this site is
    $resourceconnect_this = "";
    for ($n = 0; $n < count($resourceconnect_affiliates); $n++) {
        if ($resourceconnect_affiliates[$n]["baseurl"] == $baseurl) {
            $resourceconnect_this = $n;
            break;
        }
    }
    if ($resourceconnect_this === "") {
        exit("ResourceConnect error: current affiliate not found in configured affiliate list - ensure baseurls match");
    }
    $resourceconnect_selected = getval("resourceconnect_selected", "");
    if ($resourceconnect_selected == "" || !isset($resourceconnect_affiliates[$resourceconnect_selected])) {
        # Not yet set, default to this site
        $resourceconnect_selected = $resourceconnect_this;
    }
    #	setcookie("resourceconnect_selected",$resourceconnect_selected);
    setcookie("resourceconnect_selected", $resourceconnect_selected, 0, "/");
}
Пример #25
0
function HookResourceConnectAllInitialise()
{
    # Work out the current affiliate
    global $lang, $language, $resourceconnect_affiliates, $baseurl, $resourceconnect_selected, $resourceconnect_this;
    # Work out which affiliate this site is
    $resourceconnect_this = "";
    for ($n = 0; $n < count($resourceconnect_affiliates); $n++) {
        if ($resourceconnect_affiliates[$n]["baseurl"] == $baseurl) {
            $resourceconnect_this = $n;
            break;
        }
    }
    if ($resourceconnect_this === "") {
        exit($lang["resourceconnect_error-affiliate_not_found"]);
    }
    $resourceconnect_selected = getval("resourceconnect_selected", "");
    if ($resourceconnect_selected == "" || !isset($resourceconnect_affiliates[$resourceconnect_selected])) {
        # Not yet set, default to this site
        $resourceconnect_selected = $resourceconnect_this;
    }
    #	setcookie("resourceconnect_selected",$resourceconnect_selected);
    setcookie("resourceconnect_selected", $resourceconnect_selected, 0, "/", '', false, true);
}
Пример #26
0
    /**
     * Main
     */
    public static function main()
    {
        // vis liste over valg
        echo '
<h1>Deaktiverte brukere/spillere</h1>
<ul>
	<li><a href="deaktiverte?a=brukere">Vis deaktiverte brukere &raquo;</a></li>
	<li><a href="deaktiverte?a=spillere">Vis deaktiverte spillere &raquo;</a></li>
</ul>';
        // hva skal vi vise?
        switch (getval("a")) {
            case "brukere":
                self::add_css();
                self::vis_brukere();
                break;
            case "spillere":
                self::add_css();
                self::vis_spillere();
                break;
            default:
                ess::$b->page->add_title("Deaktiverte brukere/spillere");
        }
    }
Пример #27
0
function HookFeedbackAllHeadertop()
{
    global $target, $baseurl, $feedback_questions, $feedback_prompt_text, $pagename, $lang;
    if ($pagename == "setup" || $pagename == "feedback" || $pagename == "login" || $pagename == "user_request" || $pagename == "user_password") {
        return true;
    }
    # Do not appear on the setup page or during giving feedback, or on non-logged in pages
    # Form a check key based on the feedback form, so that form changes prompt a new message.
    # $check=md5(serialize($feedback_questions));
    if (getval("feedback_completed", "") == "") {
        ?>
		<div id="feedback_prompt" style="border:1px solid #BBB;border-bottom-width:3px;border-bottom-color:#bbb;background-color:white;width:300px;height:auto;position:absolute;top:100px;left:300px;text-align:left;padding:10px;color:black;z-index:99999;">
		<?php 
        echo $feedback_prompt_text;
        ?>
		
		<div style="text-align:right;">
		<input type="button" value="<?php 
        echo $lang["yes"];
        ?>
" onClick="SetCookie('feedback_completed','yes',30);jQuery('#feedback_prompt').remove();CentralSpaceLoad('<?php 
        echo $baseurl;
        ?>
/plugins/feedback/pages/feedback.php',true);">
		<input type="button" value="<?php 
        echo $lang["no"];
        ?>
" onClick="SetCookie('feedback_completed','yes',30);document.getElementById('feedback_prompt').style.display='none';">
		<input type="button" value="<?php 
        echo $lang["feedback_remind_me_later"];
        ?>
" onClick="SetCookie('feedback_completed','yes',0.5);document.getElementById('feedback_prompt').style.display='none';">
		</div>
		</div>
		<?php 
    }
}
/**
* Generates the CSV content of the metadata for resources passed in the array
*
* @param $resources
* @return string
*/
function generateResourcesMetadataCSV(array $resources)
{
    global $lang;
    $return = '';
    $csv_field_headers = array();
    $resources_fields_data = array();
    foreach ($resources as $resource) {
        foreach (get_resource_field_data($resource['ref'], false, true, -1, getval("k", "") != "") as $field_data) {
            $csv_field_headers[$field_data['resource_type_field']] = $field_data['title'];
            $resources_fields_data[$resource['ref']][$field_data['resource_type_field']] = $field_data['value'];
        }
    }
    $csv_field_headers = array_unique($csv_field_headers);
    // Header
    $return = '"' . $lang['resourceids'] . '","' . implode('","', $csv_field_headers) . "\"\n";
    // Results
    $csv_row = '';
    foreach ($resources_fields_data as $resource_id => $resource_fields) {
        // First column will always be Resource ID
        $csv_row = $resource_id . ',';
        // Field values
        foreach ($csv_field_headers as $column_header => $column_header_title) {
            if (!array_key_exists($column_header, $resource_fields)) {
                $csv_row .= '"",';
                continue;
            }
            foreach ($resource_fields as $field_name => $field_value) {
                if ($column_header == $field_name) {
                    $csv_row .= '"' . str_replace(array("\\n", "\\r", "\""), "//", tidylist(i18n_get_translated($field_value))) . '",';
                }
            }
        }
        $csv_row .= "\n";
        $return .= $csv_row;
    }
    return $return;
}
$done = false;
# Fetch collection data
$cinfo = get_collection($collection);
if ($cinfo === false) {
    exit("Collection not found.");
}
# Check access
if (!$cinfo["request_feedback"]) {
    exit("Access denied.");
}
# Check that comments have been added.
$comments = get_collection_comments($collection);
if (count($comments) == 0 && $feedback_resource_select == false) {
    $errors = $lang["feedbacknocomments"];
}
if (getval("save", "") != "") {
    # Save comment
    $comment = trim(getvalescaped("comment", ""));
    send_collection_feedback($collection, $comment);
    # Stay on this page for external access users (no access to search)
    refresh_collection_frame();
    $done = true;
}
$headerinsert .= "<script src=\"../lib/lightbox/js/jquery.lightbox-0.5.min.js\" type=\"text/javascript\"></script>";
$headerinsert .= "<link type=\"text/css\" href=\"../lib/lightbox/css/jquery.lightbox-0.5.css?css_reload_key=" . $css_reload_key . "\" rel=\"stylesheet\">";
include "../include/header.php";
?>
<script type="text/javascript">
	jQuery(document).ready(function(){
		jQuery('.lightbox').lightBox(); 
	
include "../include/search_functions.php";
$ref = getvalescaped("ref", "", true);
$collection = getvalescaped("collection", "", true);
# Fetch collection data
$cinfo = get_collection($collection);
if ($cinfo === false) {
    exit("Collection not found.");
}
$commentdata = get_collection_resource_comment($ref, $collection);
$comment = $commentdata["comment"];
$rating = $commentdata["rating"];
# Check access
if (!collection_readable($collection)) {
    exit("Access denied.");
}
if (getval("submitted", "") != "") {
    # Save comment
    $comment = trim(getvalescaped("comment", ""));
    $rating = trim(getvalescaped("rating", ""));
    save_collection_resource_comment($ref, $collection, $comment, $rating);
    if ($k == "") {
        redirect($baseurl_short . "pages/search.php?refreshcollectionframe=true&search=!collection" . $collection);
    } else {
        # Stay on this page for external access users (no access to search)
        refresh_collection_frame();
    }
}
include "../include/header.php";
?>
<div class="BasicsBox">
<h1><?php