Exemplo n.º 1
0
                    $article['author'] = $thread['author'];
                    $article_content['content'] = dhtmlspecialchars($thread['message']);
                    $article['attach_image'] = $article['attach_file'] = '';
                    $query = DB::query("SELECT * FROM " . DB::table(getattachtablebytid($thread['tid'])) . " WHERE pid='{$thread['pid']}' ORDER BY aid DESC");
                    while ($attach = DB::fetch($query)) {
                        $attachcode = '[attach]' . $attach['aid'] . '[/attach]';
                        if (!strexists($article_content['content'], $attachcode)) {
                            $article_content['content'] .= '<br /><br />' . $attachcode;
                        }
                        if ($attach['isimage']) {
                            if ($article['pic']) {
                                $attach['pic'] = $article['pic'];
                            }
                            $article['attach_image'] .= get_uploadcontent($attach, 'forum');
                        } else {
                            $article['attach_file'] .= get_uploadcontent($attach, 'forum');
                        }
                    }
                }
                break;
        }
    }
    if (!empty($article['dateline'])) {
        $article['dateline'] = dgmdate($article['dateline']);
    }
    $article_tags = article_parse_tags($article['tag']);
    $tag_names = article_tagnames();
}
include_once template("portal/portalcp_article");
function portalcp_get_summary($message)
{
Exemplo n.º 2
0
function portal_upload_show($attach)
{
    global $_G;
    $imagehtml = $filehtml = $coverstr = '';
    if ($attach['isimage']) {
        $imagehtml = get_uploadcontent($attach, 'portal', 'upload');
        $coverstr = addslashes(serialize(array('pic' => 'portal/' . $attach['attachment'], 'thumb' => $attach['thumb'], 'remote' => $attach['remote'])));
    } else {
        $filehtml = get_uploadcontent($attach, 'portal', 'upload');
    }
    echo '<script type="text/javascript" src="' . $_G[setting][jspath] . 'handlers.js?' . $_G['style']['verhash'] . '"></script>';
    echo '<script>';
    if ($imagehtml) {
        echo 'var tdObj = getInsertTdId(parent.$(\'imgattachlist\'), \'attach_list_' . $attach['attachid'] . '\');tdObj.innerHTML = \'' . addslashes($imagehtml) . '\';';
    }
    if ($filehtml) {
        echo 'parent.$(\'attach_file_body\').innerHTML = \'' . addslashes($filehtml) . '\'+parent.$(\'attach_file_body\').innerHTML;';
    }
    echo 'if(parent.$(\'localfile_' . $_GET['attach_target_id'] . '\') != null)parent.$(\'localfile_' . $_GET['attach_target_id'] . '\').style.display = \'none\';';
    echo 'parent.$(\'attach_ids\').value += \',' . $attach['attachid'] . '\';';
    if ($coverstr) {
        echo 'if(parent.$(\'conver\').value == \'\')parent.$(\'conver\').value = \'' . $coverstr . '\';';
    }
    echo '</script>';
}
Exemplo n.º 3
0
 if ($op == 'addpage') {
     $article_content = array();
 } else {
     $query = DB::query("SELECT * FROM " . DB::table('portal_article_content') . " WHERE aid='{$aid}' ORDER BY pageorder LIMIT {$start},1");
     $article_content = DB::fetch($query);
 }
 $article['attach_image'] = $article['attach_file'] = '';
 $query = DB::query("SELECT * FROM " . DB::table('portal_attachment') . " WHERE aid='{$aid}' ORDER BY attachid");
 while ($value = DB::fetch($query)) {
     if ($value['isimage']) {
         if ($article['pic']) {
             $value['pic'] = $article['pic'];
         }
         $article['attach_image'] .= get_uploadcontent($value);
     } else {
         $article['attach_file'] .= get_uploadcontent($value);
     }
 }
 if ($article['contents'] > 0) {
     $pageselect = '<select name="pageorder">';
     $pageselect .= "<option value=\"0\">" . lang('core', 'end') . "</option>";
     for ($i = 1; $i <= $article['contents']; $i++) {
         $selected = $op != 'addpage' && $page == $i ? ' selected' : '';
         $pageselect .= "<option value=\"{$i}\"{$selected}>{$i}</option>";
     }
     $pageselect .= '</select>';
 }
 $multi = multi($article['contents'], 1, $page, "portal.php?mod=portalcp&ac=article&aid={$aid}");
 $article['related'] = array();
 if ($page < 2 && $op != 'addpage') {
     $query = DB::query("SELECT a.aid,a.title\r\n\t\t\t\tFROM " . DB::table('portal_article_related') . " r\r\n\t\t\t\tLEFT JOIN " . DB::table('portal_article_title') . " a ON a.aid=r.raid\r\n\t\t\t\tWHERE r.aid='{$aid}' ORDER BY r.displayorder");
Exemplo n.º 4
0
function portal_upload_show($attach)
{
    $imagehtml = $filehtml = $coverstr = '';
    if ($attach['isimage']) {
        $imagehtml = get_uploadcontent($attach, 'portal', 'upload');
        $coverstr = addslashes(serialize(array('pic' => 'portal/' . $attach['attachment'], 'thumb' => $attach['thumb'], 'remote' => $attach['remote'])));
    } else {
        $filehtml = get_uploadcontent($attach, 'portal', 'upload');
    }
    echo '<script>';
    if ($imagehtml) {
        echo 'parent.$(\'attach_image_body\').innerHTML = \'' . addslashes($imagehtml) . '\'+parent.$(\'attach_image_body\').innerHTML;';
    }
    if ($filehtml) {
        echo 'parent.$(\'attach_file_body\').innerHTML = \'' . addslashes($filehtml) . '\'+parent.$(\'attach_file_body\').innerHTML;';
    }
    echo 'if(parent.$(\'localfile_' . $_GET['attach_target_id'] . '\') != null)parent.$(\'localfile_' . $_GET['attach_target_id'] . '\').style.display = \'none\';';
    echo 'parent.$(\'attach_ids\').value += \',' . $attach['attachid'] . '\';';
    if ($coverstr) {
        echo 'if(parent.$(\'conver\').value == \'\')parent.$(\'conver\').value = \'' . $coverstr . '\';';
    }
    echo '</script>';
}
Exemplo n.º 5
0
function portal_upload_show($attach)
{
    $imagehtml = $filehtml = '';
    if ($attach['isimage']) {
        $imagehtml = get_uploadcontent($attach);
    } else {
        $filehtml = get_uploadcontent($attach);
    }
    echo '<script>';
    if ($imagehtml) {
        echo 'parent.$(\'attach_image_body\').innerHTML += \'' . addslashes($imagehtml) . '\';';
    }
    if ($filehtml) {
        echo 'parent.$(\'attach_file_body\').innerHTML += \'' . addslashes($filehtml) . '\';';
    }
    echo 'if(parent.$(\'localfile_' . $_GET['attach_target_id'] . '\') != null)parent.$(\'localfile_' . $_GET['attach_target_id'] . '\').style.display = \'none\';';
    echo 'parent.$(\'attach_ids\').value += \',' . $attach['attachid'] . '\';';
    echo '</script>';
}