コード例 #1
4
function get_image()
{
    $id = rand(101, 585295);
    //id изображений на сайте начинаются со 101. 585295 далеко не последнее изображение, так что можно смело писать цифру побольше
    $url = "http://nuclear-wallpapers.ru.com/download.php?id=" . $id . "&width=1366&height=768";
    /*
    	$ch = curl_init($url);
    	curl_setopt($ch, CURLOPT_HEADER, 0);
    	$res = curl_exec($ch);
    	curl_close($ch);
    */
    $img = "http://white-wallpapers.ru/image/" . $id . "-1366-768-nuclear-wallpapers.ru.com.jpg";
    /*
     *Эту проверку делал для себя, на случай отсутствия интернета..
     */
    $check = get_headers($url);
    if ($check[0] !== 'HTTP/1.1 200 OK') {
        //проверяем, нормальный ли заголовок нам возвращается
        $dir = opendir('/mnt/trash/dl/wllpprs/');
        while (false !== ($file = readdir($dir))) {
            $images[] = $file;
        }
        shuffle($images);
        $img = '/mnt/trash/dl/wllpprs/' . $images[0];
        copy($img, '/home/nikolay/walls/wall.jpg');
    } else {
        if (!getimagesize($img)) {
            //бывает, что попадается битое изображение, так что проверяется его размер
            get_image();
        } else {
            copy('/home/nikolay/walls/wall.jpg', '/home/nikolay/walls/old_wall.jpg');
            copy($img, '/home/nikolay/walls/wall.jpg');
        }
    }
}
コード例 #2
0
 function get_list_view_data()
 {
     $data = parent::get_list_view_data();
     $delete = '';
     $group_owner = false;
     $securitygroup_name = "";
     if (empty($data['SECURITYGROUP_ID'])) {
         $securitygroup_name = "All";
     } else {
         require_once 'modules/SecurityGroups/SecurityGroup.php';
         $securitygroup = new SecurityGroup();
         $securitygroup->retrieve($data['SECURITYGROUP_ID']);
         $securitygroup_name = $securitygroup->name;
         if ($securitygroup->assigned_user_id == $GLOBALS['current_user']->id) {
             $group_owner = true;
         }
     }
     if (is_admin($GLOBALS['current_user']) || $data['CREATED_BY'] == $GLOBALS['current_user']->id || $group_owner) {
         $delete = get_image($GLOBALS['image_path'] . '/delete_inline', 'width="12" height="12" border="0" align="absmiddle" style="vertical-align: bottom;" onclick=\'Message.deleteMessage("' . $data['ID'] . '", "{this.id}")\'');
     }
     $username = "";
     if (empty($data['CREATED_BY'])) {
         $username = "******";
     } else {
         require_once 'modules/Users/User.php';
         $user = new User();
         $user->retrieve($data['CREATED_BY']);
         $username = $user->user_name;
     }
     $data['NAME'] = $data['DESCRIPTION'];
     $data['NAME'] = '<div class="list view" style="padding:5px;border:none;">' . html_entity_decode($data['NAME']);
     $data['NAME'] .= '<div class="byLineBox" style="padding-top: 2px"><span class="byLineLeft">' . $username . ' [' . $securitygroup_name . ']';
     $data['NAME'] .= '&nbsp;</span><span style="cursor: pointer;" class="byLineRight"> ' . $this->getTimeLapse($data['DATE_ENTERED']) . ' &nbsp;' . $delete . '</span></div>';
     return $data;
 }
コード例 #3
0
 function display()
 {
     global $current_language;
     if (empty($this->container_id)) {
         $child_reports = ReportContainer::get_root_reports();
     } else {
         $container = new ReportContainer();
         $container->retrieve($this->container_id);
         $child_reports = $container->get_linked_beans("reports", "ZuckerReport");
     }
     $mod_strings = return_module_language($current_language, "ZuckerReports");
     require_once 'include/ListView/ListView.php';
     $lv = new ListView();
     $lv->initNewXTemplate('modules/ZuckerReportContainer/DetailView.html', $mod_strings);
     $lv->xTemplateAssign("DELETE_INLINE_PNG", get_image($image_path . 'delete_inline.png', 'align="absmiddle" alt="' . $app_strings['LNK_DELETE'] . '" border="0"'));
     $lv->xTemplateAssign("EDIT_INLINE_PNG", get_image($image_path . 'edit_inline.png', 'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"'));
     $lv->xTemplateAssign("RETURN_URL", "&return_module=ZuckerReportContainer&return_action=DetailView&return_id=" . $container->id);
     $lv->setHeaderTitle("");
     $lv->setHeaderText("");
     ob_start();
     $lv->processListViewTwo($child_reports, "reports", "REPORT");
     $str = ob_get_clean();
     ob_end_flush();
     return parent::display() . $str;
 }
コード例 #4
0
 function get_edit_view()
 {
     global $image_path;
     $view = $this->contents;
     $counter = 0;
     $fields = get_register_values('dyn_layout_fields');
     for ($i = 0; $i < sizeof($this->slots); $i++) {
         $slot = $this->slots[$i];
         $explode = explode($slot[0], $view, 2);
         $view = $explode[0];
         if ($i > 0 && $i < sizeof($this->slots) / 2) {
             $view .= "<a href='#' onclick='add_col_to_view({$counter})' >" . get_image($image_path . "plus_inline", "border='0' alt='Add Column ->'") . "</a><a href='#' onclick='delete_col_from_view({$counter})' >" . get_image($image_path . "minus_inline", "border='0' alt='<- Delete Column '") . "</a></td><td  class='listViewThS1'>";
         } else {
             if ($i > 0 && $i > sizeof($this->slots) / 2) {
                 $view .= "</td><td >";
             }
         }
         $view .= $slot[1] . "</div>" . $explode[1];
         if ($fields) {
             foreach ($fields as $field => $field_code) {
                 if (trim($slot[1]) == trim($field_code[1]) || preg_match("'name[\\ ]*=[\\ ]*([\\'\"])" . $field_code[0] . "\\1'si", $slot[1])) {
                     $this->remove_from_add_fields($field);
                 }
             }
         }
         $this->add_to_form($counter);
         $counter++;
     }
     return $view;
 }
コード例 #5
0
ファイル: WordTemplate.php プロジェクト: aldridged/gtg-sugar
 function fill_in_additional_detail_fields()
 {
     global $current_language, $theme;
     $mod_strings = return_module_language($current_language, "ZuckerWordTemplate");
     if (!empty($this->filename)) {
         $this->template_url = $this->get_resources_dir() . $this->filename;
         $this->extension = substr($this->filename, strrpos($this->filename, ".") + 1);
     }
     $this->action_module = $this->module_dir;
     $seed = new QueryTemplate();
     $this->querytemplate = $seed->retrieve($this->querytemplate_id);
     if (empty($this->querytemplate)) {
         $seed = new ListingTemplate();
         $this->querytemplate = $seed->retrieve($this->querytemplate_id);
     }
     if (!empty($this->querytemplate)) {
         $this->querytemplate_name = $this->querytemplate->name;
         $this->querytemplate_link = "index.php?module=" . $this->querytemplate->module_dir . "&action=DetailView&record=" . $this->querytemplate->id;
     }
     if ($this->extension == "stw" || $this->extension == "odt") {
         $this->type_desc = $mod_strings["LBL_OPENOFFICE"];
         $this->image_html = get_image("themes/" . $theme . "/images/ZuckerOpenOfficeTemplate", "alt=\"ZuckerOpenOfficeTemplate\"");
         $this->image_module = "ZuckerOpenOfficeTemplate";
     } else {
         if ($this->extension == "doc") {
             $this->type_desc = $mod_strings["LBL_WORD"];
             $this->image_html = get_image("themes/" . $theme . "/images/ZuckerWordTemplate", "alt=\"ZuckerWordTemplate\"");
             $this->image_module = "ZuckerWordTemplate";
         }
     }
     $this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);
     $this->team_name = SimpleTeams::get_assigned_team_name($this);
 }
コード例 #6
0
function remove_image($connection, $id)
{
    remove_image_file(get_image($connection, $id));
    $delete_image_by_id_stmt = delete_image_by_id_stmt($connection);
    $delete_image_by_id_stmt->bind_param("i", $id);
    catch_execution_error($delete_image_by_id_stmt->execute(), $connection);
}
 function displayList(&$layout_def)
 {
     global $app_strings;
     global $image_path;
     $parent_record_id = $_REQUEST['record'];
     $parent_module = $_REQUEST['module'];
     $action = 'UpDown';
     $record = $layout_def['fields']['ID'];
     $current_module = $layout_def['module'];
     $return_module = $_REQUEST['module'];
     //$return_action = 'SubPanelViewer';
     $subpanel = $layout_def['subpanel_id'];
     $return_id = $_REQUEST['record'];
     if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) {
         $linked_field = $layout_def['linked_field_set'];
     } else {
         $linked_field = $layout_def['linked_field'];
     }
     $refresh_page = 0;
     if (!empty($layout_def['refresh_page'])) {
         $refresh_page = 1;
     }
     $return_url = "index.php?module={$return_module}&action={$return_action}&subpanel={$subpanel}&record={$return_id}&sugar_body_only=1&inline=1";
     // $icon_up_text = $app_strings['LNK_REMOVE'];
     $icon_down_html = get_image($image_path . 'downarrow_inline', 'align="absmiddle" alt="' . $icon_remove_text . '" border="0"');
     $icon_up_html = get_image($image_path . 'uparrow_inline', 'align="absmiddle" alt="' . $icon_remove_text . '" border="0"');
     //based on listview since that lets you select records
     if ($layout_def['ListView'] && !$hideremove) {
         $linkUp = "<a href=\"javascript:upDown('{$subpanel}', 'up', '{$record}', {$refresh_page});\"" . " class=\"listViewTdToolsS1\">{$icon_up_html}</a>";
         $linkDown = "<a href=\"javascript:upDown('{$subpanel}', 'down', '{$record}', {$refresh_page});\"" . " class=\"listViewTdToolsS1\">{$icon_down_html}</a>";
         return $linkUp . '&nbsp;' . $linkDown;
     } else {
         return '';
     }
 }
コード例 #8
0
 function prepSlots()
 {
     $this->parseCols($this->curText);
     global $image_path;
     $view = $this->curText;
     $counter = 0;
     $midpoint = floor(count($this->cols)) / 2 - 2;
     foreach ($this->cols as $col) {
         $explode = explode($col[0], $view, 2);
         if ($this->positionCount($col[0]) > 0 && $this->rowCount($col[2] . '</tr>') == 0) {
             if ($counter <= $midpoint) {
                 $view = $explode[0] . "<td class='tabDetailViewDF' nowrap><a href='javascript:void(0);' onclick='addNewColToView(\"studiocol{$counter}\", {$counter})' >" . get_image($image_path . "plus_inline", "border='0' alt='Add Row'") . "</a>&nbsp;<a href='javascript:void(0);' onclick='deleteColFromView(\"studiocol{$counter}\", {$counter})' >" . get_image($image_path . "minus_inline", "border='0' alt='Remove col'") . "</a></td>";
                 $view .= $col[1] . " id='studiocol{$counter}' >";
             } else {
                 $view = $explode[0] . '<td>&nbsp;</td>' . $col[1] . " id='studiocol{$counter}b' >";
             }
             $view .= $col[2] . $col[3] . $explode[1];
             $this->addSlotToForm($counter);
             $counter++;
         } else {
             $view = $explode[0] . $col[0] . $explode[1];
         }
     }
     $this->slotCount = $counter;
     return $view;
 }
コード例 #9
0
ファイル: is-archived.php プロジェクト: wsander3/Pipe-Dream
function pd_is_archived($post_id, $field = NULL)
{
    // check if there are any custom fields
    $meta = get_post_custom($post_id);
    if ($meta) {
        if (isset($meta['_cp_id'])) {
            $meta['_cp_id'] = get_cp_id($meta['_cp_id']);
        }
        if (isset($meta['_author'])) {
            $meta['_author'] = get_author($meta['_author']);
        }
        if (isset($meta['_author_position'])) {
            $meta['_author_position'] = get_author_position($meta['_author_position']);
        }
        if (isset($meta['_image1'])) {
            $meta['_image1'] = get_image($meta['_image1']);
        }
        if (isset($meta['_legacy_id'])) {
            $meta['_legacy_id'] = get_legacy_id($meta['_legacy_id']);
        }
        if ($field == '_image1') {
            return $meta['_image1'];
        }
        if ($field == '_author') {
            if (isset($meta['_author'])) {
                return $meta['_author'];
            }
            return false;
        }
        return $meta;
    }
    // the article is not from the archives
    return false;
}
コード例 #10
0
ファイル: counting.php プロジェクト: ebrowne7/MyMathSkilz
function display_counting_problem($argument1)
{
    $img = get_image('+');
    $randimg = $img[rand(0, count($img) - 1)];
    if ($randimg == '') {
        $randimg = 'blank.gif';
    }
    echo "<table width=440px border=0 valign=top cellpadding=0 cellspacing=0>\n\t<tr valign=top>";
    echo "<td > ";
    if ($argument1 == 0) {
        echo "<img src='img/blank.gif'>";
    }
    for ($i = 0; $i < $argument1; $i++) {
        echo "<img src='img/add/{$randimg}' >";
        if ($argument1 < 20) {
            if ($i !== 0 && ($i + 1) % 5 == 0) {
                echo "<br/>";
            }
        } else {
            if ($i !== 0 && ($i + 1) % 10 == 0) {
                echo "<br/>";
            }
        }
    }
    echo "</td>";
    echo "</tr><tr><td><input type=hidden name=argument1 value={$argument1}>How Manay ? <input type=text name='result' value='' size='5'> </td></tr></table><input type=submit value='submit'>";
}
コード例 #11
0
ファイル: Bug50285Test.php プロジェクト: jgera/sugarcrm_dev
 public function testGetImageFunctionWithAllParameters()
 {
     try {
         $this->assertNotNull(get_image("select", '', null, null, ".gif", "test alt text"));
     } catch (Exception $e) {
         $this->fail('Call to get_image function with all parameters causes exception:  ' . $e->getMessage());
     }
 }
コード例 #12
0
ファイル: image_helper.php プロジェクト: toni-leigh/shlinks
function thumbnail_tag($img, $size, $resize = null, $classes = '')
{
    $img = get_image($img);
    if (null == $resize) {
        $resize = $size;
    }
    $img_url = thumbnail_url($img, $size);
    return "<img class='" . $classes . "' itemprop='image' src='" . $img_url . "' alt='thumbail of " . $img['image_name'] . "' width='" . $resize . "' height='" . $resize . "' title='" . $img['image_name'] . "'/>";
}
コード例 #13
0
ファイル: Pbase.php プロジェクト: glial/glial
 public function getInfo()
 {
     $link = "http://www.pbase.com/wongtsushi/image/80484674&exif=Y";
     $link = "http://www.pbase.com/ingotkfr/image/132082042";
     $link = "http://www.pbase.com/ingotkfr/image/93124337";
     $link = "http://www.pbase.com/wongtsushi/image/80273259";
     //$url = "http://www.pbase.com/ingotkfr/image/102977507&exif=Y";
     $url = $link . "&exif=Y";
     $data = array();
     $ele = explode("/", $url);
     $data['author'] = $ele[3];
     $data['url_context'] = $link;
     $data['url_md5'] = md5($data['url_context']);
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_PROXY, 'proxy.int.world.socgen:8080');
     curl_setopt($ch, CURLOPT_PROXYUSERPWD, "aurelien.lequoy:Zeb33tln1\$");
     curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0");
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_URL, $url);
     $content = curl_exec($ch);
     curl_close($ch);
     $tab = Grabber::getTagContent($content, '<table width=0 border=0 align="center" class="imagetable">', true);
     $img = Grabber::getTagContent($tab, '<IMG');
     $elem = explode('"', $img);
     $data['url_found'] = $elem[3];
     $img_name = pathinfo($data['url_found']);
     $data['name'] = $img_name['basename'];
     get_image($data['url_found'], $data['name']);
     $info = getimagesize($data['name']);
     $data['width'] = $info[0];
     $data['height'] = $info[1];
     $data['md5'] = md5_file($data['name']);
     $title = Grabber::getTagContent($content, '<h3 class="title"', true);
     $data['title'] = trim(strip_tags($title));
     $location = Grabber::getTagContent($content, '<h3 class="location"', true);
     $data['location'] = trim(strip_tags($location));
     $legend = Grabber::getTagContent($content, '<div id="imagecaption" class="imagecaption">', true);
     $data['legend'] = trim(strip_tags($legend));
     $exif = Grabber::getTagContent($content, '<div id="techinfo" class="techinfo">', true);
     $camera = Grabber::getTagContent($exif, '<span class="camera">', true);
     $data['camera'] = trim(strip_tags($camera));
     $data_exif = Grabber::getTagContents($exif, '<tr', true);
     $hh = array();
     foreach ($data_exif as $line) {
         $dd = Grabber::getTagContents($line, '<td class=lid', true);
         if ($dd == false) {
             continue;
         }
         $hh[$dd[0]] = $dd[1];
     }
     $data['exif'] = $hh;
     echo "<pre>";
     print_r($data);
     echo "</pre>";
 }
コード例 #14
0
ファイル: QueryTemplate.php プロジェクト: omusico/sugar_work
 function fill_in_additional_detail_fields()
 {
     global $current_language, $theme;
     $mod_strings = return_module_language($current_language, "ZuckerQueryTemplate");
     $this->action_module = $this->module_dir;
     $this->type_desc = $mod_strings["LBL_QUERY"];
     $this->image_html = get_image("themes/" . $theme . "/images/ZuckerQueryTemplate", "alt=\"ZuckerQueryTemplate\"");
     $this->image_module = "ZuckerQueryTemplate";
     $this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);
     $this->team_name = SimpleTeams::get_assigned_team_name($this);
 }
 function displayList(&$layout_def)
 {
     global $app_strings;
     global $image_path;
     $edit_icon_html = get_image($image_path . 'edit_inline', 'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"');
     if ($layout_def['EditView']) {
         return "<a href='#' onClick=\"javascript:quickEditItem('" . $layout_def['fields']['ID'] . "');\"" . ' class="listViewTdToolsS1">' . $edit_icon_html . '&nbsp;' . $app_strings['LNK_EDIT'] . '</a>&nbsp;';
     } else {
         return '';
     }
 }
 function displayList(&$layout_def)
 {
     global $app_strings;
     global $image_path;
     $parent_record_id = $_REQUEST['record'];
     $parent_module = $_REQUEST['module'];
     $action = 'DeleteRelationship';
     $record = $layout_def['fields']['ID'];
     $return_module = $_REQUEST['module'];
     $return_action = 'SubPanelViewer';
     $subpanel = $layout_def['subpanel_id'];
     $return_id = $_REQUEST['record'];
     if ($return_module == 'Calls') {
         require_once 'modules/Calls/Call.php';
         $focus = new Call();
     } else {
         if ($return_module == 'Meetings') {
             require_once 'modules/Meetings/Meeting.php';
             $focus = new Meeting();
         } else {
             if ($return_module == 'MySettings') {
                 global $beanList, $beanFiles;
                 $return_module = $_REQUEST['loadModule'];
                 $class = $beanList[$return_module];
                 require_once $beanFiles[$class];
                 $focus = new $class();
             }
         }
     }
     $focus->retrieve($return_id);
     if ($focus->assigned_user_id == $record) {
         return '';
     }
     if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) {
         $linked_field = $layout_def['linked_field_set'];
     } else {
         $linked_field = $layout_def['linked_field'];
     }
     $refresh_page = 0;
     if (!empty($layout_def['refresh_page'])) {
         $refresh_page = 1;
     }
     $return_url = "index.php?module={$return_module}&action={$return_action}&subpanel={$subpanel}&record={$return_id}&sugar_body_only=1";
     $icon_remove_text = $app_strings['LNK_REMOVE'];
     $icon_remove_html = get_image($image_path . 'delete_inline', 'align="absmiddle" alt="' . $icon_remove_text . '" border="0"');
     $remove_url = $layout_def['start_link_wrapper'] . "index.php?module={$parent_module}" . "&action={$action}" . "&record={$parent_record_id}" . "&linked_field={$linked_field}" . "&linked_id={$record}" . "&return_url=" . urlencode(urlencode($return_url)) . "&refresh_page={$refresh_page}" . $layout_def['end_link_wrapper'];
     $remove_confirmation_text = $app_strings['NTC_REMOVE_CONFIRMATION'];
     //based on listview since that lets you select records
     if ($layout_def['ListView']) {
         return '<a href="' . $remove_url . '"' . ' class="listViewTdToolsS1"' . " onclick=\"return confirm('{$remove_confirmation_text}');\"" . ">{$icon_remove_html}&nbsp;{$icon_remove_text}</a>";
     } else {
         return '';
     }
 }
コード例 #17
0
 function fill_in_additional_detail_fields()
 {
     global $current_language, $theme;
     global $png_support;
     $mod_strings = return_module_language($current_language, "ZuckerListingTemplate");
     $this->action_module = $this->module_dir;
     $this->type_desc = $mod_strings["LBL_LISTING"];
     $this->image_html = get_image("themes/" . $theme . "/images/" . $this->mainmodule, $this->mainmodule);
     $this->image_module = $this->mainmodule;
     $this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);
     $this->team_name = SimpleTeams::get_assigned_team_name($this);
 }
 function displayList(&$layout_def)
 {
     global $app_strings;
     global $image_path;
     $href = 'index.php?module=' . 'Documents' . '&action=' . 'EditView' . '&record=' . $layout_def['fields']['ID'] . '&return_module=' . $_REQUEST['module'] . '&return_action=' . 'DetailView' . '&return_id=' . $_REQUEST['record'] . '&load_signed_id=' . $layout_def['fields']['LINKED_ID'] . '&parent_id=' . $_REQUEST['record'] . '&parent_name=' . $layout_def['fields']['CONTRACT_NAME'] . '&parent_type=' . $_REQUEST['module'] . '&selected_revision_id=' . $layout_def['fields']['SELECTED_REVISION_ID'];
     $edit_icon_html = get_image($image_path . 'loadSignedDocument', 'align="absmiddle" alt="' . $app_strings['LNK_LOAD_SIGNED'] . '" border="0"');
     //if the contract state is executed or document is not a template hide this action.
     if (!empty($layout_def['fields']['CONTRACT_STATUS']) && $layout_def['fields']['CONTRACT_STATUS'] == 'executed' or empty($layout_def['fields']['IS_TEMPLATE']) or $layout_def['fields']['IS_TEMPLATE'] == 0) {
         return "";
     }
     return '<a href="' . $href . '"' . "title ='" . $app_strings['LNK_LOAD_SIGNED_TOOLTIP'] . "'" . 'class="listViewTdToolsS1">' . $edit_icon_html . '&nbsp;' . $app_strings['LNK_LOAD_SIGNED'] . '</a>&nbsp;';
 }
コード例 #19
0
 function displayList(&$layout_def)
 {
     global $app_strings;
     global $image_path;
     $href = 'index.php?module=' . $layout_def['module'] . '&action=' . 'EditView' . '&record=' . $layout_def['fields']['ID'] . '&return_module=' . $_REQUEST['module'] . '&return_action=' . 'DetailView' . '&return_id=' . $_REQUEST['record'];
     $edit_icon_html = get_image($image_path . 'edit_inline', 'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"');
     if ($layout_def['EditView']) {
         return '<a href="' . $href . '"' . 'class="listViewTdToolsS1">' . $edit_icon_html . '&nbsp;' . $app_strings['LNK_EDIT'] . '</a>&nbsp;';
     } else {
         return '';
     }
 }
コード例 #20
0
 function get_edit_view()
 {
     global $image_path;
     $view = $this->contents;
     $counter = 0;
     $module_name = $_SESSION['dyn_layout_module'];
     foreach ($this->slots as $slot) {
         $explode = explode($slot[0], $view, 2);
         $view = $explode[0] . "<a href='#' onclick='window.frames[\"labeleditor\"].document.location=\"index.php?module=LabelEditor&action=EditView&style=popup&sugar_body_only=1&refresh_parent=1&module_name={$module_name}&record=" . $slot[1] . "\"'>" . get_image($image_path . 'edit_inline', 'border="0" align="absmiddle"') . "</a>&nbsp;<a href='#' onclick='window.frames[\"labeleditor\"].document.location=\"index.php?module=LabelEditor&action=EditView&style=popup&sugar_body_only=1&refresh_parent=1&module_name={$module_name}&record=" . $slot[1] . "\"'>" . $slot[0] . "</a>" . $explode[1];
         $counter++;
     }
     return $view;
 }
コード例 #21
0
ファイル: images.php プロジェクト: Brunton22/gbtravel
function state_id()
{
    include 'connect_db.php';
    $state_name = $_POST['state_name'];
    $sql = "SELECT state_ID FROM states WHERE state_name ='{$state_name}'";
    $result = mysqli_query($conn, $sql);
    if ($result = mysqli_query($conn, $sql)) {
        while ($row = mysqli_fetch_row($result)) {
            $state_no = $row[0];
            get_image($state_no);
        }
    }
}
 function displayList(&$layout_def)
 {
     global $app_strings;
     global $image_path;
     $href = 'index.php?module=' . $layout_def['module'] . '&action=' . 'ContactOpportunityRelationshipEdit' . '&record=' . $layout_def['fields']['OPPORTUNITY_ROLE_ID'] . '&return_module=' . $_REQUEST['module'] . '&return_action=' . 'DetailView' . '&return_id=' . $_REQUEST['record'];
     $edit_icon_html = get_image($image_path . 'edit_inline', 'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"');
     //based on listview since that lets you select records
     if ($layout_def['ListView']) {
         return '<a href="' . $href . '"' . 'class="listViewTdToolsS1">' . $edit_icon_html . '&nbsp;' . $app_strings['LNK_EDIT'] . '</a>&nbsp;';
     } else {
         return '';
     }
 }
コード例 #23
0
ファイル: otr.func.php プロジェクト: Subtech-tk/notice-board
function otr($heading = 'heading', $content = 'content goes here', $link = '#', $dated, $images = 'shopping')
{
    if (function_exists('get_image')) {
        $image = get_image($images);
    }
    if (function_exists('get_date')) {
        $dated = get_date($dated);
    }
    ?>

<div class="mdl-card on-the-road-again mdl-cell mdl-cell--12-col">
	<style>
		.demo-blog .on-the-road-again .mdl-card__media 
		{
		  /*background-image: url(<?php 
    echo "{$image}";
    ?>
) ! important;*/
		  height: 240px ! important;
		}
	</style>
	<div class="mdl-card__media mdl-color-text--grey-50" style="background-image: url(<?php 
    echo "{$image}";
    ?>
)">
		<h3><a href=<?php 
    echo "\"{$link}\"";
    ?>
><?php 
    echo "{$heading}";
    ?>
</a></h3>
	</div>
	<div class="mdl-color-text--grey-600 mdl-card__supporting-text">
		<?php 
    echo "{$content}";
    ?>
	</div>
	<div class="mdl-card__supporting-text meta mdl-color-text--grey-600">
		<!--<div class="minilogo"></div>-->
		<div>
			<strong></strong>
			<span><?php 
    echo "Posted on - {$dated}";
    ?>
</span>
		</div>
	</div>
</div>
<?php 
}
コード例 #24
0
 function generateButtons()
 {
     global $image_path;
     $imageSave = get_image($image_path . 'studio_save', '');
     $imagePublish = get_image($image_path . 'studio_publish', '');
     $imageHistory = get_image($image_path . 'studio_history', '');
     $imageAddRows = get_image($image_path . 'studio_addRows', '');
     $imageUndo = get_image($image_path . 'studio_undo', '');
     $imageRedo = get_image($image_path . 'studio_redo', '');
     $buttons = array();
     $buttons[] = array('image' => $imageSave, 'text' => $GLOBALS['mod_strings']['LBL_BTN_SAVE'], 'actionScript' => "onclick='if(lastTabIndex)lastTabIndex.blur();document.studio.submit()' ");
     $buttons[] = array('image' => $imageHistory, 'text' => $GLOBALS['mod_strings']['LBL_BTN_HISTORY'], 'actionScript' => "onclick='if(!confirmNoSave())return false;document.location.href=\"index.php?module=Studio&action=wizard&wizard=ManageBackups&setFile={$_SESSION['studio']['selectedFileId']}\"'");
     return $buttons;
 }
コード例 #25
0
ファイル: widget.php プロジェクト: rinodung/myfreetheme
 function generate_item($post_ID, $atts)
 {
     // these arguments will be available from inside $content
     $image = array('post_id' => $post_ID, 'echo' => false, 'responsive' => true, 'class' => 'img-responsive');
     $image_tag = get_image($image);
     // item tempalte
     $item_tmpl = '
     <li>
         <a class="thumb-info" href="' . get_permalink($post_ID) . '">
             ' . $image_tag . '
         </a>
     </li>';
     return $item_tmpl;
 }
コード例 #26
0
	function widget($args, $instance) {
		global $post;
		
		$posts = get_field('post', 'widget_'.$args['widget_id']);


		if( $posts ) :
			echo $args['before_widget']; 
			?>

				<?php foreach($posts as $post) : ?>
				<?php setup_postdata($post); ?>
				<?php 
					$author_id = get_the_author_meta('ID');
					$author_image = get_field('image', 'user_'. $author_id);
					$author_img_url = get_avatar_url ( $author_id, $size = '40' );
					$author_url = get_author_posts_url($author_id);
					$excerpt = get_the_excerpt();
					$excerpt = (strlen($excerpt) > 150) ? '"'.substr($excerpt,0,150).'" ...' : $excerpt;

				 ?>

					<img class="image" src="<?php echo get_image(get_post_thumbnail_id($post->ID), array(180, 180)); ?>">
					<div class="script">
						<img src="<?php bloginfo('template_directory'); ?>/images/misc/editors-letter.png" alt="">	
					</div>
					<a href="<?php echo $author_url; ?>">
						<div class="author">
								<div class="image circle">
										<img src="<?php echo $author_img_url; ?>" />
								</div>
								<span class="name"><?php echo the_author_meta( "display_name", $author_id ); ?></span>
						</div>	
					</a>
					<div class="date">
						february 01,2015
					</div>
					
					<div class="bio">
						<?php echo $excerpt; ?>	
						<a class="read-more" href="<?php the_permalink(); ?>">Read Further &raquo;</a>	
					</div>
				<?php endforeach;	?>
			<? 
			echo $args['after_widget'];	
		endif;
		
		
	}
コード例 #27
0
 function process()
 {
     global $current_language, $app_list_strings, $image_path, $current_user;
     $mod_strings = return_module_language($current_language, 'Calls');
     if ($this->myItemsOnly) {
         // handle myitems only differently
         $lvsParams = array('custom_from' => ' INNER JOIN calls_users ON calls.id = calls_users.call_id ', 'custom_where' => ' AND calls_users.deleted = 0 AND (calls.assigned_user_id = \'' . $current_user->id . '\' OR calls_users.user_id = \'' . $current_user->id . '\') ', 'distinct' => true);
     } else {
         $lvsParams = array();
     }
     $this->myItemsOnly = false;
     parent::process($lvsParams);
     $keys = array();
     foreach ($this->lvs->data['data'] as $num => $row) {
         $keys[] = $row['ID'];
     }
     if (!empty($keys)) {
         $query = "SELECT call_id, accept_status FROM calls_users WHERE user_id = '" . $current_user->id . "' AND call_id IN ('" . implode("','", $keys) . "')";
         $result = $GLOBALS['db']->query($query);
         while ($row = $GLOBALS['db']->fetchByAssoc($result)) {
             $rowNums = $this->lvs->data['pageData']['idIndex'][$row['call_id']];
             // figure out which rows have this guid
             foreach ($rowNums as $rowNum) {
                 $this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] = $row['accept_status'];
             }
         }
     }
     foreach ($this->lvs->data['data'] as $rowNum => $row) {
         if (empty($this->lvs->data['data'][$rowNum]['DURATION_HOURS'])) {
             $this->lvs->data['data'][$rowNum]['DURATION'] = '0' . $mod_strings['LBL_HOURS_ABBREV'];
         } else {
             $this->lvs->data['data'][$rowNum]['DURATION'] = $this->lvs->data['data'][$rowNum]['DURATION_HOURS'] . $mod_strings['LBL_HOURS_ABBREV'];
         }
         if (empty($this->lvs->data['data'][$rowNum]['DURATION_MINUTES']) || empty($this->seedBean->minutes_values[$this->lvs->data['data'][$rowNum]['DURATION_MINUTES']])) {
             $this->lvs->data['data'][$rowNum]['DURATION'] .= '00';
         } else {
             $this->lvs->data['data'][$rowNum]['DURATION'] .= $this->seedBean->minutes_values[$this->lvs->data['data'][$rowNum]['DURATION_MINUTES']];
         }
         if ($this->lvs->data['data'][$rowNum]['STATUS'] == "Planned") {
             if ($this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] == '') {
                 $this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = "<div id=\"accept" . $this->id . "\"><a title=\"" . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=" . $this->id . "&object_type=Call&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=accept', null, null, SUGAR.sugarHome.retrieveDashlet, '{$this->id}');\">" . get_image($image_path . "accept_inline", "alt='" . $app_list_strings['dom_meeting_accept_options']['accept'] . "' border='0'") . "</a>&nbsp;<a title=\"" . $app_list_strings['dom_meeting_accept_options']['tentative'] . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=" . $this->id . "&object_type=Call&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=tentative', null, null, SUGAR.sugarHome.retrieveDashlet, '{$this->id}');\">" . get_image($image_path . "tentative_inline", "alt='" . $app_list_strings['dom_meeting_accept_options']['tentative'] . "' border='0'") . "</a>&nbsp;<a title=\"" . $app_list_strings['dom_meeting_accept_options']['decline'] . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activitiess&to_pdf=1&action=SetAcceptStatus&id=" . $this->id . "&object_type=Call&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=decline', null, null, SUGAR.sugarHome.retrieveDashlet, '{$this->id}');\">" . get_image($image_path . "decline_inline", "alt='" . $app_list_strings['dom_meeting_accept_options']['decline'] . "' border='0'") . "</a></div>";
             } else {
                 $this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = $app_list_strings['dom_meeting_accept_status'][$this->lvs->data['data'][$rowNum]['ACCEPT_STATUS']];
             }
         }
         $this->lvs->data['data'][$rowNum]['DURATION'] .= $mod_strings['LBL_MINSS_ABBREV'];
     }
     $this->displayColumns[] = "set_accept_links";
 }
コード例 #28
0
 function get_edit_view()
 {
     global $image_path;
     $view = $this->contents;
     $counter = 0;
     foreach ($this->slots as $slot) {
         $explode = explode($slot[0], $view, 2);
         if ($this->slot_count($slot[0]) > 0 && $this->row_count($slot[2] . '</tr>') == 0) {
             $view = $explode[0] . $slot[1] . "<td class='tabDetailViewDF' nowrap><a href='#' onclick='add_row_to_view({$counter})' >" . get_image($image_path . "plus_inline", "border='0' alt='Add Row'") . "</a>&nbsp;<a href='#' onclick='delete_row_from_view({$counter})' >" . get_image($image_path . "minus_inline", "border='0' alt='Remove row'") . "</a></td>" . $slot[2] . $slot[3] . $explode[1];
         } else {
             $view = $explode[0] . $slot[0] . $explode[1];
         }
         $counter++;
     }
     return $view;
 }
コード例 #29
0
 function widget($args, $instance)
 {
     global $post;
     $args['category_id'] = isset($instance['category_id']) ? $instance['category_id'] : null;
     $category = get_category($args['category_id']);
     if ($category) {
         echo $args['before_widget'];
         $image_id = get_field('image', 'category_' . $category->term_id);
         $sub_title = get_field('sub_title', 'category_' . $category->term_id);
         $image_url = get_image($image_id, array('width' => 400, 'height' => 220));
         include_module('category-btn', array('url' => get_term_link($category), 'image_url' => $image_url, 'name' => $category->name, 'sub_title' => $sub_title));
         echo $args['after_widget'];
         wp_reset_postdata();
         wp_reset_query();
     }
 }
 function displayList(&$layout_def)
 {
     global $app_strings;
     global $image_path;
     $parent_record_id = $_REQUEST['record'];
     $parent_module = $_REQUEST['module'];
     $action = 'DeleteRelationship';
     $record = $layout_def['fields']['ID'];
     $current_module = $layout_def['module'];
     //in document revisions subpanel ,users are now allowed to
     //delete the latest revsion of a document. this will be tested here
     //and if the condition is met delete button will be removed.
     $hideremove = false;
     if ($current_module == 'DocumentRevisions') {
         if ($layout_def['fields']['ID'] == $layout_def['fields']['LATEST_REVISION_ID']) {
             $hideremove = true;
         }
     } elseif ($_REQUEST['module'] == 'Teams' && $current_module == 'Users') {
         if ($layout_def['fields']['UPLINE'] != translate('LBL_TEAM_UPLINE_EXPLICIT', 'Users')) {
             $hideremove = true;
         }
     }
     $return_module = $_REQUEST['module'];
     $return_action = 'SubPanelViewer';
     $subpanel = $layout_def['subpanel_id'];
     $return_id = $_REQUEST['record'];
     if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) {
         $linked_field = $layout_def['linked_field_set'];
     } else {
         $linked_field = $layout_def['linked_field'];
     }
     $refresh_page = 0;
     if (!empty($layout_def['refresh_page'])) {
         $refresh_page = 1;
     }
     $return_url = "index.php?module={$return_module}&action={$return_action}&subpanel={$subpanel}&record={$return_id}&sugar_body_only=1&inline=1";
     $icon_remove_text = $app_strings['LNK_REMOVE'];
     $icon_remove_html = get_image($image_path . 'delete_inline', 'align="absmiddle" alt="' . $icon_remove_text . '" border="0"');
     $remove_url = $layout_def['start_link_wrapper'] . "index.php?module={$parent_module}" . "&action={$action}" . "&record={$parent_record_id}" . "&linked_field={$linked_field}" . "&linked_id={$record}" . "&return_url=" . urlencode(urlencode($return_url)) . "&refresh_page={$refresh_page}" . $layout_def['end_link_wrapper'];
     $remove_confirmation_text = $app_strings['NTC_REMOVE_CONFIRMATION'];
     //based on listview since that lets you select records
     if ($layout_def['ListView'] && !$hideremove) {
         return '<a href="' . $remove_url . '"' . ' class="listViewTdToolsS1"' . " onclick=\"return confirm('{$remove_confirmation_text}');\"" . ">{$icon_remove_html}&nbsp;{$icon_remove_text}</a>";
     } else {
         return '';
     }
 }