Example #1
0
function external_edit_menu_file($data)
{
    global $CONFIG, $CURRENT_ALBUM_DATA, $USER_DATA, $CPG_PHP_SELF, $lang_plugin_external_edit, $external_edit_icon_array;
    $valid_extension_array = array('jpg', 'jpeg', 'png');
    $locale_array = array('english' => 'en-US', 'danish' => 'da-DK', 'german' => 'de-DE', 'spanish' => 'es-ES', 'argentinian' => 'es-LA', 'finnish' => 'fi-FI', 'french' => 'fr-FR', 'italian' => 'it-IT', 'japanese' => 'ja-JP', 'korean' => 'ko-KR', 'norwegian' => 'nb-NO', 'belgian' => 'nl-BE', 'dutch' => 'nl-NL', 'polish' => 'pl-PL', 'brazilian_portuguese' => 'pt-BR', 'portuguese' => 'pt-PT', 'russian' => 'ru-RU', 'swedish' => 'sv-SE', 'turkish' => 'tu-TR', 'vietnamese' => 'vi-VN', 'chinese_big5' => 'zh-CN', 'chinese_gb' => 'zh-TW');
    $current_page = cpgGetScriptNameParams(array('message_id', 'message_icon'));
    //print_r($foo);
    if (USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID || $CONFIG['users_can_edit_pics'] && $data['owner_id'] == USER_ID && USER_ID != 0 || GALLERY_ADMIN_MODE) {
        // Determine the file type
        if (!in_array(strtolower($data['extension']), $valid_extension_array) == TRUE) {
            // We don't have a bitmap - let's leave
            return $data;
        }
        // Create the database record
        $token = external_edit_create_token($data);
        if (array_key_exists($CONFIG['lang'], $locale_array) == TRUE) {
            $locale = $locale_array[$CONFIG['lang']];
        } else {
            $locale = 'en-US';
        }
        $menu_button = ' <a href="';
        $menu_button .= 'http://fotoflexer.com/API/API_Loader_v1_01.php';
        $menu_button .= '?ff_image_url=' . urlencode($CONFIG['site_url'] . $CONFIG['fullpath'] . $data['filepath'] . $data['filename']);
        //$menu_button .= '?ff_image_url=' . urlencode('http://osterburken.net/galerie/albums/konzert/05/just_rock/gg02.jpg'); // Comment out the line above and uncomment this line for testing purposes
        $menu_button .= '&amp;ff_callback_url=' . urlencode($CONFIG['site_url'] . 'index.php?file=external_edit/index') . '%26t=' . $token;
        $menu_button .= '&amp;ff_cancel_url=' . urlencode($CONFIG['site_url'] . 'displayimage.php?pid=' . $data['pid']);
        $menu_button .= '&amp;ff_lang=' . $locale;
        $menu_button .= '"  class="admin_menu greyboxfull" title="' . $lang_plugin_external_edit['edit_file_explain'] . '">';
        $menu_button .= $external_edit_icon_array['fotoflexer'];
        $menu_button .= $lang_plugin_external_edit['edit_file'];
        $menu_button .= '</a>';
        $data['menu'] = str_replace('</ul>', $menu_button . '</ul>', $data['menu']);
    }
    return $data;
}
Example #2
0
    }
    // Display pagination
    $record_selector = '&nbsp;&nbsp;-&nbsp;&nbsp;<select name="amount" size="1" onchange="sendForm();" class="listbox">';
    foreach ($amount_allowed as $key) {
        $record_selector .= '<option value="' . $key . '" ';
        if ($amount == $key) {
            $record_selector .= ' selected="selected"';
        }
        $record_selector .= '>' . $key . '</option>' . $line_break;
    }
    $record_selector .= '</select> ' . $lang_stat_details_php['records_per_page'] . $line_break;
    $stats_tmpl = $template_tab_display;
    $stats_tmpl['left_text'] = strtr($stats_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_stat_details_php['records_on_page'] . $record_selector));
    $stats_tmpl['inactive_tab'] = strtr($stats_tmpl['inactive_tab'], array('{LINK}' => cpgGetScriptNameParams('page') . 'page=%d#details'));
    $stats_tmpl['inactive_next_tab'] = strtr($stats_tmpl['inactive_next_tab'], array('{LINK}' => cpgGetScriptNameParams('page') . 'page=%d#details'));
    $stats_tmpl['inactive_prev_tab'] = strtr($stats_tmpl['inactive_prev_tab'], array('{LINK}' => cpgGetScriptNameParams('page') . 'page=%d#details'));
    $tabs = create_tabs($count, $page, $numPages, $stats_tmpl);
    $tableColumnsPlus = $tableColumns + 1;
    print <<<EOT
  <tr>
      <td align="right" valign="top" colspan="{$tableColumnsPlus}">
          <table border="0" cellspacing="0" cellpadding="0" width="100%">
              <tr>
                  {$tabs}
              </tr>
          </table>
      </td>
  </tr>
EOT;
    // display table footer with options
    $hide_internal_selected = $hide_internal == '1' ? 'checked="checked"' : '';
        }
    }
    $result->free();
    // Display pagination
    $record_selector = '&nbsp;&nbsp;-&nbsp;&nbsp;<select name="amount" size="1" onchange="sendForm();" class="listbox">';
    foreach ($amount_allowed as $key) {
        $record_selector .= '<option value="' . $key . '" ';
        if ($amount == $key) {
            $record_selector .= ' selected="selected"';
        }
        $record_selector .= '>' . $key . '</option>' . $LINEBREAK;
    }
    $record_selector .= '</select> ' . $lang_stat_details_php['records_per_page'] . $LINEBREAK;
    $stats_tmpl = $template_tab_display;
    $stats_tmpl['left_text'] = strtr($stats_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_stat_details_php['records_on_page'] . $record_selector));
    $stats_tmpl['page_link'] = strtr($stats_tmpl['page_link'], array('{LINK}' => cpgGetScriptNameParams('page') . 'page=%d#details'));
    $tabs = create_tabs($count, $page, $numPages, $stats_tmpl);
    $tableColumnsPlus = $tableColumns + 1;
    print <<<EOT
  <tr>
      <td align="right" valign="top" colspan="{$tableColumnsPlus}">
          <table border="0" cellspacing="0" cellpadding="0" width="100%">
              <tr>
                  {$tabs}
              </tr>
          </table>
      </td>
  </tr>
EOT;
    // display table footer with options
    $hide_internal_selected = $hide_internal == '1' ? 'checked="checked"' : '';
/**
 * themeSelect()
 *
 * @param $parameter
 * @return
 **/
function themeSelect($parameter)
{
    global $CONFIG, $lang_theme_selection, $lang_common, $CPG_PHP_SELF, $LINEBREAK;
    $return = '';
    $cpgCurrentTheme = cpgGetScriptNameParams('theme') . 'theme=';
    // get list of available themes
    $value = $CONFIG['theme'];
    $theme_dir = 'themes/';
    $dir = opendir($theme_dir);
    while ($file = readdir($dir)) {
        if (is_dir($theme_dir . $file) && $file != "." && $file != ".." && $file != '.svn' && $file != 'sample') {
            $theme_array[] = $file;
        }
    }
    closedir($dir);
    natcasesort($theme_array);
    $return .= $LINEBREAK . '<div id="cpgChooseThemeWrapper">' . $LINEBREAK . '<form name="cpgChooseTheme" id="cpgChooseTheme" action="' . $CPG_PHP_SELF . '" method="get" class="inline">' . $LINEBREAK;
    $return .= '<select name="theme" class="listbox_lang" onchange="if (this.options[this.selectedIndex].value) window.location.href=\'' . $cpgCurrentTheme . '\' + this.options[this.selectedIndex].value;">' . $LINEBREAK;
    $return .= '<option selected="selected">' . $lang_theme_selection['choose_theme'] . '</option>';
    foreach ($theme_array as $theme) {
        $return .= '<option value="' . $theme . '"' . ($value == $theme ? '  selected="selected"' : '') . '>' . strtr(ucfirst($theme), '_', ' ') . ($value == $theme ? '  *' : '') . '</option>' . $LINEBREAK;
    }
    $return .= '<option value="xxx">' . $lang_theme_selection['reset_theme'] . '</option>' . $LINEBREAK;
    $return .= '</select>' . $LINEBREAK;
    $return .= '<noscript>' . $LINEBREAK;
    $return .= '<input type="submit" name="theme_submit" value="' . $lang_common['go'] . '" class="listbox_lang" />&nbsp;' . $LINEBREAK;
    $return .= '</noscript>' . $LINEBREAK;
    $return .= '</form>' . $LINEBREAK;
    $return .= '</div>' . $LINEBREAK;
    return $return;
}
Example #5
0
function social_bookmarks_pagelink()
{
    global $CONFIG, $CPG_PHP_SELF;
    $allowed_filenames = array('contact.php', 'displayecard.php', 'displayimage.php', 'displayreport.php', 'ecard.php', 'export.php', 'index.php', 'login.php', 'register.php', 'report_file.php', 'upload.php', 'xp_publish.php');
    $forbidden_parameters = array('message_id', 'form_token', 'timestamp', 'user_id', 'referer', 'lang', 'theme');
    if (in_array($CPG_PHP_SELF, $allowed_filenames) == TRUE) {
        $return = $CONFIG['site_url'] . rtrim(cpgGetScriptNameParams($forbidden_parameters), '&');
    } else {
        $return = $CONFIG['site_url'] . 'index.php';
    }
    return $return;
}
Example #6
0
/**
 * cpgSocialBookmark()
 *
 * @return
 **/
function cpgSocialBookmark()
{
    global $CONFIG, $lang_social_bookmarks;
    $return = '';
    if ($CONFIG['display_social_bookmarks'] != 0) {
        $addressParamsToRemove_array = array('message_id', 'theme');
        $url = $CONFIG['ecards_more_pic_target'] . rawurlencode(str_replace('&amp;', '&', rtrim(cpgGetScriptNameParams($addressParamsToRemove_array), '&amp;')));
        $title = rawurlencode($CONFIG['gallery_name']);
        $description = rawurlencode($CONFIG['gallery_description']);
        $socialBookmarks_array = array(array('name' => 'digg.com', 'url' => 'http://www.digg.com/submit?url={URL}', 'icon' => 'images/bookmarks/digg.gif'), array('name' => 'del.icio.us', 'url' => 'http://del.icio.us/post?url={URL}&title={TITLE}', 'icon' => 'images/bookmarks/del.icio.us.gif'), array('name' => 'Yahoo MyWeb', 'url' => 'http://myweb2.search.yahoo.com/myresults/bookmarklet?t={TITLE}&u={URL}', 'icon' => 'images/bookmarks/myweb.yahoo.gif'), array('name' => 'technorati', 'url' => 'http://technorati.com/cosmos/search.html?url={URL}', 'icon' => 'images/bookmarks/technorati.gif'), array('name' => 'Spurl', 'url' => 'http://www.spurl.net/spurl.php?url={URL}&title={TITLE}', 'icon' => 'images/bookmarks/spurl.gif'), array('name' => 'Furl', 'url' => 'http://www.furl.net/storeIt.jsp?t={TITLE}&u={URL}', 'icon' => 'images/bookmarks/furl.gif'), array('name' => 'Blinklist', 'url' => 'http://www.blinklist.com/index.php?Action=Blink/addblink.php&Description={DESCRIPTION}&Url={URL}&Title={TITLE}', 'icon' => 'images/bookmarks/blinklist.gif'), array('name' => 'Fark', 'url' => 'http://cgi.fark.com/cgi/fark/edit.pl?new_url={URL}&new_comment={TITLE}', 'icon' => 'images/bookmarks/fark.gif'), array('name' => 'Blogmarks', 'url' => 'http://blogmarks.net/my/new.php?mini=1&simple=1&url={URL}&title={TITLE}', 'icon' => 'images/bookmarks/blogmarks.gif'), array('name' => 'Simpy', 'url' => 'http://www.simpy.com/simpy/LinkAdd.do?href={URL}&title={TITLE}', 'icon' => 'images/bookmarks/simpy.gif'), array('name' => 'Reddit', 'url' => 'http://reddit.com/submit?url={URL}&title={TITLE}', 'icon' => 'images/bookmarks/reddit.gif'), array('name' => 'StumbleUpon', 'url' => 'http://www.stumbleupon.com/submit?url={URL}&newcomment={DESCRIPTION}&title={TITLE}', 'icon' => 'images/bookmarks/stumbleupon.gif'), array('name' => 'Slashdot', 'url' => 'http://slashdot.org/bookmark.pl?url={URL}&tags={DESCRIPTION}&title={TITLE}', 'icon' => 'images/bookmarks/slashdot.gif'), array('name' => 'Netscape', 'url' => 'http://www.netscape.com/submit/?U={URL}&storyText={DESCRIPTION}&storyTags=&T={TITLE}', 'icon' => 'images/bookmarks/netscape.gif'), array('name' => 'diigo', 'url' => 'http://www.diigo.com/post?url={URL}&title={TITLE}&tag=&comments={DESCRIPTION}', 'icon' => 'images/bookmarks/diigo.gif'), array('name' => 'NewsVine', 'url' => 'http://www.newsvine.com/_wine/save?popoff=1&u={URL}&tags={DESCRIPTION}&blurb={TITLE}', 'icon' => 'images/bookmarks/newsvine.gif'), array('name' => 'ma.gnolia', 'url' => 'http://ma.gnolia.com/bookmarklet/add?url={URL}&title={TITLE}&description={DESCRIPTION}', 'icon' => 'images/bookmarks/ma.gnolia.gif'), array('name' => 'Google', 'url' => 'http://www.google.com/bookmarks/mark?op=add&bkmk={URL}&annotation={DESCRIPTION}&labels=&title={TITLE}', 'icon' => 'images/bookmarks/google.gif'), array('name' => 'Mister Wong', 'url' => 'http://www.mister-wong.de/index.php?action=addurl&bm_url={URL}&bm_description={DESCRIPTION}', 'icon' => 'images/bookmarks/misterbook.gif'), array('name' => 'Linkarena', 'url' => 'http://www.linkarena.com/bookmarks/addlink/?url={URL}&title={TITLE}', 'icon' => 'images/bookmarks/linkarena.gif'), array('name' => 'Newskick.de', 'url' => 'http://www.newskick.de/submit.php?url={URL}', 'icon' => 'images/bookmarks/newskick.gif'), array('name' => 'Weblinkr.com', 'url' => 'http://weblinkr.com/login?action=add&address={URL}&description={DESCRIPTION}', 'icon' => 'images/bookmarks/weblinkr.gif'), array('name' => 'Alltagz', 'url' => 'http://www.alltagz.de/bookmarks/?action=add&address={URL}&title={TITLE}', 'icon' => 'images/bookmarks/alltagz.gif'), array('name' => 'Webbrille.de', 'url' => 'http://www.webbrille.de/bookmarks.php/?action=add&address={URL}&title={TITLE}', 'icon' => 'images/bookmarks/webbrille.gif'), array('name' => 'Newstube.de', 'url' => 'http://newstube.de/submit.php?url={URL}', 'icon' => 'images/bookmarks/newstube.gif'), array('name' => 'Webnews.de', 'url' => 'http://www.webnews.de/einstellen?url={URL}&title={TITLE}', 'icon' => 'images/bookmarks/webnews.gif'), array('name' => 'Readster.de', 'url' => 'http://www.readster.de/submit/?url={URL}&title={TITLE}', 'icon' => 'images/bookmarks/readster.gif'), array('name' => 'oneview.de', 'url' => 'http://www.oneview.de/quickadd/neu/addBookmark.jsf?URL={URL}&title={TITLE}', 'icon' => 'images/bookmarks/oneview.gif'), array('name' => 'Maodi.de', 'url' => 'http://www.maodi.de/bookmarks/?action=add&address={URL}&title={TITLE}', 'icon' => 'images/bookmarks/maodi.gif'), array('name' => 'Tausendreporter', 'url' => 'http://tausendreporter.stern.de/submit.php?url={URL}', 'icon' => 'images/bookmarks/tausendreporter.gif'), array('name' => 'Linksilo', 'url' => 'http://www.linksilo.de/index.php?area=bookmarks&func=bookmark_new&addurl={URL}&addtitle={TITLE}', 'icon' => 'images/bookmarks/linksilo.gif'));
        $return = '<div id="social_bookmarks_wrapper">';
        $return .= '<div class="social_bookmarks" id="social_bookmarks_text">' . $lang_social_bookmarks['add_this_page_to'] . ': </div>';
        $countLoop = 0;
        $social_bookmarks_config_array = explode("|", $CONFIG['display_social_bookmarks']);
        foreach ($socialBookmarks_array as $key) {
            if ($social_bookmarks_config_array[$countLoop] == 1) {
                $key['url'] = str_replace('{URL}', $url, $key['url']);
                $key['url'] = str_replace('{TITLE}', $title, $key['url']);
                $key['url'] = str_replace('{DESCRIPTION}', $description, $key['url']);
                $return .= '<div class="social_bookmarks"><a href="' . $key['url'] . '" rel="external" class="external social_bookmarks2">';
                $return .= '<img src="' . $key['icon'] . '" border="0" alt="" class="social_bookmarks2" title="' . sprintf($lang_social_bookmarks['bookmark_this_page'], $key['name']) . '" />';
                $return .= '</a></div>';
            }
            $countLoop++;
        }
        $return .= '</div>';
        $return = "\r\n" . '<script type="text/javascript">' . "\r\n" . 'document.write(\'' . $return . '\');' . "\r\n" . '</script>' . "\r\n";
    }
    return $return;
}