header

Collapse

How do you convert a vB4 widget to a vB5 widget?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Go to Thank You Onone
    Junior Member
    • 01.2021
    • 19
    • 1
    • 0

    Font Size
    #1

    How do you convert a vB4 widget to a vB5 widget?

    Go to Thank You
    I have a widget script that I have used successfully on vB4.
    Now I need to have it work with vB5. I have included the code
    to one of them below. If anybody can point me to some useful
    info to convert this, I would greatly appreciate it.
    Thank you!
    Rick



    HTML Code:
    // Set Your Category ID Here ='11, 12, 13'
    $category = '40';
    // Set The Number of Articles To Display
    $offset = '0';
    $limit = '6';
    // Set The Height of The Thumbnail Image
    // $height = '';
    // Set The Width of The Thumbnail Image
    //$width = '175';
    $now = time();
    
    $articlegrab = vB::$db->query_read("
    SELECT ".TABLE_PREFIX."cms_nodeinfo.nodeid
    , ".TABLE_PREFIX."cms_nodeinfo.title
    , ".TABLE_PREFIX."cms_nodeinfo.associatedthreadid
    , ".TABLE_PREFIX."cms_article.previewimage
    , ".TABLE_PREFIX."cms_article.previewtext
    , ".TABLE_PREFIX."cms_article.pagetext
    , ".TABLE_PREFIX."cms_article.contentid
    , ".TABLE_PREFIX."cms_node.nodeid
    , ".TABLE_PREFIX."cms_node.parentnode
    , ".TABLE_PREFIX."cms_node.contentid
    , ".TABLE_PREFIX."cms_node.url
    , ".TABLE_PREFIX."cms_node.publishdate
    , ".TABLE_PREFIX."cms_category.category
    , ".TABLE_PREFIX."cms_category.categoryid
    , ".TABLE_PREFIX."cms_node.setpublish
    FROM ".TABLE_PREFIX."cms_node
    INNER
    JOIN ".TABLE_PREFIX."cms_article
    ON ".TABLE_PREFIX."cms_article.contentid = ".TABLE_PREFIX."cms_node.contentid
    INNER
    JOIN ".TABLE_PREFIX."cms_nodeinfo
    ON ".TABLE_PREFIX."cms_nodeinfo.nodeid = ".TABLE_PREFIX."cms_node.nodeid
    INNER
    JOIN ".TABLE_PREFIX."cms_nodecategory
    ON ".TABLE_PREFIX."cms_nodecategory.nodeid = ".TABLE_PREFIX."cms_node.nodeid
    INNER
    JOIN ".TABLE_PREFIX."cms_category
    ON ".TABLE_PREFIX."cms_category.categoryid = ".TABLE_PREFIX."cms_nodecategory.categoryid
    WHERE ".TABLE_PREFIX."cms_category.categoryid IN ($category)
    AND (" .TABLE_PREFIX."cms_node.publishdate < $now)
    AND (" .TABLE_PREFIX."cms_node.setpublish != 0)
    ORDER
    BY ".TABLE_PREFIX."cms_node.publishdate DESC LIMIT $limit OFFSET $offset
    ");
    
    while($articleinfo = vB::$db->fetch_array($articlegrab)) {
    
    $title = $articleinfo['title'];
    $image = $articleinfo['previewimage'];
    $text = $articleinfo['previewtext'];
    $nodeid = $articleinfo['nodeid'];
    $threadid = $articleinfo['associatedthreadid'];
    $url = $articleinfo['url'];
    $unixdate = $articleinfo['publishdate'];
    $date = date("F j, Y, g:i a", $unixdate);
    $fulltext = strip_bbcode($fulltext);
    $text = preg_replace('/\[ATTACH\=CONFIG\]\d\d\[\/ATTACH\]/', '', $text);
    $text = strip_bbcode($text);
    if ($threadid)
    {
    $numcom = vB::$db->query_first("SELECT replycount from thread where threadid = '$threadid'");
    $comments = $numcom['replycount'];
    }
    
    if($text == '') $text = substr($fulltext, 0,150);
    
    $output .= '<div><center>';
    if ($image != '')
    $output .= "<a href='content.php?" . $nodeid . "-" . $url . "'>" . "<img src=" . $image . " width='355' align='left' style='padding:0 5px 0px 0'/></a>";
    $output .= "<a href='content.php?" . $nodeid . "-" . $url . "'><span class='feature'>
    " . $title . "</span></a><br /></span></center><div class='fsc_newstext'><p style='min-height: 80px;'>" . $text . "</p></div>" . "<span class='date'>" . $date . "</span>" . "<div>" . "<span class='cms_article_readmore'><a href='content.php?" . $nodeid . "-" . $url . "'>Read More <img src='fsc/images/cms/read_more-right.png' alt='Read More' /></a></span>";
    if ($comments)
    {
    if ($comments == 1)
    $comword = " Comment";
    else
    $comword = " Comments";
    $output .= "<span class='cms_article_comment_number'>" . "<a href='content.php?" . $nodeid . "-" . $url . "#comments_start'>" . "<img class='inlineimg' src='fsc/images/buttons/firstnew-comment.png' alt='' /></a>" . "<a href='content.php?" . $nodeid . "-" . $url . "#comments_start' rel='nofollow'>" . $comments . $comword . "</a></span>";
    }
    $output .= "</div>";
    $output .= "<br><hr></div>";
    
    }
    Go to Top of Post
    Last edited by yilmaz; 22.02.21, 18:13.
    Similar Threads
X

Thread Information

Collapse

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

    Those who read this thread

    Collapse

    Members who have read this thread: 1

    Related Topics

    Collapse

    Topics Statistics Last Post
    Started by vB-Info, 2 weeks ago
    0 responses
    4 views
    0 reactions
    Last Post vB-Info
    by vB-Info
    Started by vB-Info, 2 weeks ago
    0 responses
    2 views
    0 reactions
    Last Post vB-Info
    by vB-Info
    Started by vB-Info, 13.03.24, 20:42
    0 responses
    21 views
    0 reactions
    Last Post vB-Info
    by vB-Info
    Working...
    😀
    😂
    🥰
    😘
    🤢
    😎
    😞
    😡
    👍
    👎

    AdBlock Detected

    Please Disable Adblock

    Please consider supporting us by disabling the ad blocker.

    I've Disabled AdBlock
    Home