vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   vBulletin Blog - Latest Blogs on Home Page (https://vborg.vbsupport.ru/showthread.php?t=156652)

Blackhat 09-24-2007 08:48 AM

can I get this into a sidebar instead of the bottom ?

AzH 10-06-2007 07:58 AM

<a href="http://lurkingmastermind.com/forums/blogs/evil/yesterday-s-entries-30/" target="_blank">http://lurkingmastermind.com/forums/...-s-entries-30/</a>

Problem. Entries saved as draft appear in the latest blogs table and when click naturally throw up an error message.

Hengest 10-06-2007 01:54 PM

Just installed, thanks!

Edit: How do I hide this from non members or any other user group?

zCarot 10-11-2007 06:53 PM

I made fix for private blog entries. Not good (I just cut some code form blog_functions), but works =)
PHP Code:

//Latest Blogs

require_once(DIR '/includes/blog_functions_shared.php');

$having_or = array();
    if (!
can_moderate_blog())
    {
        if (
$vbulletin->userinfo['userid'])
        {
            
$having_or[] = "userid = " $vbulletin->userinfo['userid'];
            
$having_or[] = "(bu.options_ignore & " $vbulletin->bf_misc_vbblogsocnetoptions['canviewmyblog'] . " AND ignoreid IS NOT NULL)";
            
$having_or[] = "(bu.options_buddy & " $vbulletin->bf_misc_vbblogsocnetoptions['canviewmyblog'] . " AND buddyid IS NOT NULL)";
            
$having_or[] = "(bu.options_everyone & " $vbulletin->bf_misc_vbblogsocnetoptions['canviewmyblog'] . " AND (bu.options_buddy & " $vbulletin->bf_misc_vbblogsocnetoptions['canviewmyblog'] . " OR buddyid IS NULL) AND (bu.options_ignore & " $vbulletin->bf_misc_vbblogsocnetoptions['canviewmyblog'] . " OR ignoreid IS NULL))";
        }
        else
        {
            
$having_or[] = "bu.options_everyone & " $vbulletin->bf_misc_vbblogsocnetoptions['canviewmyblog'];
        }
    }

    
$having_join = array();
    
$having_select = array();
    if (
$vbulletin->userinfo['userid'])
    {
        
$having_join[] = "LEFT JOIN " TABLE_PREFIX "userlist AS buddy ON (buddy.userid = blog.userid AND buddy.relationid = " $vbulletin->userinfo['userid'] . " AND buddy.type = 'buddy')";
        
$having_join[] = "LEFT JOIN " TABLE_PREFIX "userlist AS ignored ON (ignored.userid = blog.userid AND ignored.relationid = " $vbulletin->userinfo['userid'] . " AND ignored.type = 'ignore')";
        
$having_select[] = "ignored.relationid AS ignoreid, buddy.relationid AS buddyid";
    }

$latestblogs $db->query(
    SELECT blog.blogid, blog.title, blog.username, blog.dateline, blog.userid, blog.views, options_everyone, options_buddy
    " 
. (!empty($having_select) ? ", " implode(", "$having_select) : "") . "
    FROM " 
TABLE_PREFIX "blog as blog
    LEFT JOIN " 
TABLE_PREFIX "blog_user as bu ON (bu.bloguserid = blog.userid)
    " 
. (!empty($having_join) ? implode("\r\n"$having_join) : "") . "
    WHERE blog.state='visible' AND blog.pending='0'
    " 
. (!empty($having_or) ? "HAVING " implode("\r\n\tOR "$having_or) : "") . "
    ORDER BY blog.dateline DESC 
    LIMIT 10 
"
); 
while (
$showblogs=$db->fetch_array($latestblogs)) 

    
$showblogsprivate false;
    if (
can_moderate() AND $showblogs['userid'] != $vbulletin->userinfo['userid'])
    {
        
$everyoneelsecanview $showblogs['options_everyone'] & $vbulletin->bf_misc_vbblogsocnetoptions['canviewmyblog'];
        
$buddiescanview $showblogs['options_buddy'] & $vbulletin->bf_misc_vbblogsocnetoptions['canviewmyblog'];
        if (!
$everyoneelsecanview AND (!$showblogs['buddyid'] OR !$buddiescanview))
        {
            
$showblogsprivate true;
        }
    }

    
$counter++; 
    
$blog_userid $showblogs['userid'];
    
$blogid $showblogs['blogid'];
    
$blog_title $showblogs['title'];
    
$blog_views $showblogs['views'];
    
$blog_username $showblogs['username'];
    
$blog_dateline vbdate($vbulletin->options['dateformat'], $showblogs['dateline']);
   
    if (
$showblogsprivate)
        
$spitblogs_title .= '<img class="inlineimg" src="/images/misc/blog/key.gif" alt="Private Entry"  border="0" />'// very bad code =)
    
$spitblogs_title .= "<a href=\"blog.php?b=$blogid\">$blog_title</a>";
    
$spitblogs_title .= "<br /> ";
    
$spitblogs_views .= $blog_views;
    
$spitblogs_views .= "<br /> ";
    
$spitblogs_username .= "<a href=\"blog.php?u=$blog_userid\">$blog_username</a>";
    
$spitblogs_username .= "<br /> ";
    
$spitblogs_date .= $blog_dateline;
    
$spitblogs_date .= "<br /> ";
    
    if (
$counter 5
    { 
        
$spitblogs .= "<br /> "
    } 
    elseif (
$counter == 5)
    {
        break;
    }
}
//Latest Blogs 


imprezion 10-18-2007 01:43 AM

how do I install the blogs in my homepage instead of the forum home?

lifanovsky 10-21-2007 03:05 PM

Quote:

Originally Posted by zCarot (Post 1357718)
I made fix for private blog entries. Not good (I just cut some code form blog_functions), but works =)

Thanks for the Russian translation, zCarot - using it. 8)

Concerning the hack you provided - it caused troubles when I tried to use it - half of my users could access the forum. So I switched back to the original version...

Thanks for the try anyway...

zCarot 10-21-2007 03:29 PM

Quote:

Originally Posted by lifanovsky (Post 1365116)
Thanks for the Russian translation, zCarot - using it. 8)

You're welcome
Quote:

Originally Posted by lifanovsky (Post 1365116)
Concerning the hack you provided - it caused troubles when I tried to use it - half of my users could access the forum. So I switched back to the original version...

Thanks for the try anyway...

DB error (show it)? Or just blank page?

BigDog56 10-24-2007 04:31 PM

Very nice! Thank you, looks good!

mmmender 10-26-2007 06:42 AM

I've got a major problem with this on my forumhome. I think it may be due to the fact that my server admin recently upgraded to php5. Installing the product as-is and making the template edit as-is I get a black table where the list of recent blogs is supposed to be (see image). I tried altering both the .xml file and the template edit to replace any .php extensions with .php5 extensions but I'm still getting a black table instead of the blog data. Can you please help?

mmmender 10-26-2007 08:21 AM

I solved the problem myself. It was a style problem. I think you should mention in your read me file that people might want it to match their forums styles so, personally, I would change this:

Code:

<td class="smallfont">$spitblogs_username</td>
<td class="smallfont">$spitblogs_title</td>
<td class="smallfont">$spitblogs_views</td>
<td class="smallfont">$spitblogs_date</td>

to this:
Code:

<td class="alt2">$spitblogs_username</td>
<td class="alt1">$spitblogs_title</td>
<td class="alt1">$spitblogs_views</td>
<td class="alt1">$spitblogs_date</td>



All times are GMT. The time now is 01:42 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01257 seconds
  • Memory Usage 1,784KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete