[BETA] - The Blog Mod

This forum contains member submitted mods and hacks for IntegraMOD/IM Portal versions

*please read the "Read Me" post*

Moderator: Integra Moderator

Re: [BETA] - The Blog Mod

PostAuthor: Dragonsys » Thu Apr 13, 2006 6:55 am

it is in the .cfg file. If I read the documents right, when you create a .cfg file for a block, it should show up in the ACP under variables.
Last edited by Dragonsys on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Image
User avatar
Dragonsys
Sr Integra Member
Sr Integra Member
 
Posts: 326
Likes: 0 post
Liked in: 0 post
Joined: Mon Apr 10, 2006 6:45 am
Cash on hand: 0.00
Location: Springtown, TX

PostAuthor: Jason Sanborn » Thu Apr 13, 2006 7:07 am

Eon: You're correct, but the issue is that you need a separate control for the Blog, as opposed to the same one used for topics, so that they can be independantly controlled.
Last edited by Jason Sanborn on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 9:40 am
Cash on hand: 0.00
Location: Marina, CA

PostAuthor: Eon » Thu Apr 13, 2006 8:07 am

Right. I understand that. Whe I edited my recent_topics block variables it automatically put the options in the IM Portal Config page.

I think you may be on the right track with the cfg file.

Then once you get the config file you should be able to add a variable for the blog mod.
Last edited by Eon on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Eon
Sr Integra Member
Sr Integra Member
 
Posts: 627
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 28, 2006 9:15 am
Cash on hand: 0.00

Re: [BETA] - The Blog Mod

PostAuthor: Dragonsys » Thu Apr 13, 2006 10:58 am

here is what I have:

blocks/blocks_imp_blogs.cfg
Code: Select all
<php>sql_query($sql) ) {    message_die(GENERAL_ERROR, "Couldn't obtain weblogs information.", "", __LINE__, __FILE__, $sql);    $recent_blogs .= "No Blogs"; } else {    $recent_entries = array();    while ( $row = $db->sql_fetchrow($result) )    {       $recent_entries[] = $row;    }        foreach ($recent_entries as $current)    {       $recent_blogs .= "&raquo;" . "<a><b>";     // Entry Link       $recent_blogs .= $current['entry_subject'];                          // Subject       $recent_blogs .= "</b></a><br>n            ";                // End and html formatting         $recent_blogs .= "by <a>";    // User Link       $recent_blogs .= $current['username'] . "</a> on ";                     // User Name       $recent_blogs .= date("D M j, Y g:i a",$current['entry_time']);                  // Post Date       $recent_blogs .= "</b></a><br><br>n            ";               // End and html formatting    }           if($portal_config['md_blogs_style']){             $style_row = 'scroll';         }else         {             $style_row = 'static';         }           $template->assign_block_vars($style_row,"");      $template->assign_vars(array(    'RECENT_BLOGS' => $recent_blogs,    'YOUR_BLOG' => $userdata['user_weblog']    )    );     }    } } imp_blogs_block_func(); ?>


When I tried to change the .tpl file I get errors, since I cannot set these options in the ACP, so for now, the .tpl file has not changed.
Last edited by Dragonsys on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Image
User avatar
Dragonsys
Sr Integra Member
Sr Integra Member
 
Posts: 326
Likes: 0 post
Liked in: 0 post
Joined: Mon Apr 10, 2006 6:45 am
Cash on hand: 0.00
Location: Springtown, TX

Re: [BETA] - The Blog Mod

PostAuthor: Helter » Thu Apr 13, 2006 11:15 am

outstanding work guys, and thank you Dragonsys. I run this on my own forum. Pm me when your satisfied with the state of your zip, and ill update the dl section
Last edited by Helter on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Always use Protection
Image


Please do not PM for support
User avatar
Helter
Administrator
Administrator
 
Posts: 4168
Likes: 0 post
Liked in: 0 post
Images: 0
Joined: Sat Mar 11, 2006 3:46 pm
Cash on hand: 187.60
Location: Seattle Wa
IntegraMOD version: IM 3

Re: [BETA] - The Blog Mod

PostAuthor: Dragonsys » Tue Apr 18, 2006 6:22 am

Ok, those block files work. just had to clear all my cache to get the variables to show up in ACP (thanks Helter)

I'll get to work on the .tpl file now.
Last edited by Dragonsys on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Image
User avatar
Dragonsys
Sr Integra Member
Sr Integra Member
 
Posts: 326
Likes: 0 post
Liked in: 0 post
Joined: Mon Apr 10, 2006 6:45 am
Cash on hand: 0.00
Location: Springtown, TX

Re: [BETA] - The Blog Mod

PostAuthor: Dragonsys » Wed Apr 19, 2006 8:11 am

I got it all working. Below is the code I used. I will add this to the download file very soon.

SQL Code to add to database:
Code: Select all
INSERT INTO `phpbb_portal_config` VALUES ( '', 'md_num_blogs', '10' );INSERT INTO `phpbb_portal_config` VALUES ( '', 'md_blogs_style', '0' );



templates/fisubice/blocks/blogs_block.tpl
Code: Select all
<table><tr><td><span><BEGIN><marquee><BEGIN>{scroll.recent_blog_row.RECENT_BLOGS}<END></marquee><END><BEGIN><BEGIN>{static.recent_blog_row.RECENT_BLOGS}<END><END></span></td></tr><tr>    <td>    <hr><br><a>All Blogs</a> | <a>Your Blog</a>    </td> </tr> </table>


blocks/blocks_imp_blogs.cfg
Code: Select all
<?php/***************************************************************************  *                       blocks_imp_blogs.cfg  *                            -------------------  *   copyright            ]http://www.dragonsys.org[/url]  *   email                : [url=http://www.dragonsys.org]http://www.dragonsys.org[/url]  *   email                : <a>webmaster@dragonsys.org</a>  *  *   note: removing the original copyright is illegal even you have modified  *         the code.  Just append yours if you have modified it.  ***************************************************************************/  /***************************************************************************  *  *   This program is free software; you can redistribute it and/or modify  *   it under the terms of the GNU General Public License as published by  *   the Free Software Foundation; either version 2 of the License, or  *   (at your option) any later version.  *  ***************************************************************************/  if ( !defined('IN_PHPBB') ) {    die("Hacking attempt"); }  if(!function_exists(imp_blogs_block_func)) {    function imp_blogs_block_func()    {        global $template, $userdata, $phpbb_root_path, $phpEx, $db, $board_config, $lang, $portal_config, $_GET;  // // Pugio Edit For Recent Blogs Support //    // Get recent entries or print out an error $sql = "SELECT entry_subject, entry_id, entry_poster_id, entry_time, username, user_id    FROM " . WEBLOG_ENTRIES_TABLE . ", " . USERS_TABLE . "    WHERE " . USERS_TABLE . ".user_id" . " = " . WEBLOG_ENTRIES_TABLE . ".entry_poster_id    ORDER BY entry_time DESC    LIMIT " . $portal_config['md_num_blogs'];  if( !$result = $db->sql_query($sql) ) {    message_die(GENERAL_ERROR, "Couldn't obtain weblogs information.", "", __LINE__, __FILE__, $sql);    $recent_blogs .= "No Blogs"; } else {    $recent_entries = array();    while ( $row = $db->sql_fetchrow($result) )    {       $recent_entries[] = $row;    }        foreach ($recent_entries as $current)    {       $recent_blogs .= "&raquo;" . "<a><b>";     // Entry Link       $recent_blogs .= $current['entry_subject'];                          // Subject       $recent_blogs .= "</b></a><br>n            ";                // End and html formatting         $recent_blogs .= "by <a>";    // User Link       $recent_blogs .= $current['username'] . "</a> on ";                     // User Name       $recent_blogs .= date("D M j, Y g:i a",$current['entry_time']);                  // Post Date       $recent_blogs .= "</b></a><br><br>n            ";               // End and html formatting    }           if($portal_config['md_blogs_style']){             $style_row = 'scroll';         }else         {             $style_row = 'static';         }           $template->assign_block_vars($style_row,"");      $template->assign_block_vars($style_row . '.recent_blog_row', array(    'RECENT_BLOGS' => $recent_blogs    )    );      $template->assign_vars(array(    'RECENT_BLOGS' => $recent_blogs,    'YOUR_BLOG' => $userdata['user_weblog']    )    );     }    } } imp_blogs_block_func(); ?>
Last edited by Dragonsys on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Image
User avatar
Dragonsys
Sr Integra Member
Sr Integra Member
 
Posts: 326
Likes: 0 post
Liked in: 0 post
Joined: Mon Apr 10, 2006 6:45 am
Cash on hand: 0.00
Location: Springtown, TX

PostAuthor: Michaelo » Sun Apr 23, 2006 2:57 pm

Let us know when the download on this site is updated... or post a link to latest.
Mike
Last edited by Michaelo on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Kiss Portal Engine phpbbireland (status: Released)
User avatar
Michaelo
Administrator
Administrator
 
Posts: 1646
Likes: 0 post
Liked in: 0 post
Joined: Sat Mar 11, 2006 5:14 pm
Cash on hand: 0.00
Location: Dublin, Ireland

Re: [BETA] - The Blog Mod

PostAuthor: Dragonsys » Mon Apr 24, 2006 5:06 am

I have updated the 1st post with the new download file.
Last edited by Dragonsys on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Image
User avatar
Dragonsys
Sr Integra Member
Sr Integra Member
 
Posts: 326
Likes: 0 post
Liked in: 0 post
Joined: Mon Apr 10, 2006 6:45 am
Cash on hand: 0.00
Location: Springtown, TX

PostAuthor: Michaelo » Mon Apr 24, 2006 1:06 pm

Many thanks...
Last edited by Michaelo on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Kiss Portal Engine phpbbireland (status: Released)
User avatar
Michaelo
Administrator
Administrator
 
Posts: 1646
Likes: 0 post
Liked in: 0 post
Joined: Sat Mar 11, 2006 5:14 pm
Cash on hand: 0.00
Location: Dublin, Ireland

PostAuthor: napukjon » Tue Apr 25, 2006 5:39 am

Installed this but now get this error when i go to mange my Blogs.

[code]Parse error]

Any help would be appreciated!
Last edited by napukjon on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http]NaPUK - Finding the Truth behind the Legends of England, Scotland and Wales![/url]

napukjon
Members
Members
 
Posts: 83
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:54 am
Cash on hand: 0.00

PostAuthor: Dragonsys » Tue Apr 25, 2006 6:28 am

[quote=""napukjon";p="3017""]Installed this but now get this error when i go to mange my Blogs.

Code: Select all
Parse error]

Any help would be appreciated![/quote]

Please double check your file edits of the admin/admin_groups.php file

Here is the code for just that file:
[code]#  #-----[ OPEN ]------------------------------------------  #  admin/admin_groups.php    #  #-----[ FIND ]------------------------------------------  #         $group_info = array (            'group_name' => '',            'group_description' => '',            'group_moderator' => '',    #  #-----[ AFTER, ADD ]------------------------------------------  #            'group_allow_weblogs' => 0,    #  #-----[ FIND ]------------------------------------------  #         'U_SEARCH_USER' => append_sid("../search.$phpEx?mode=searchuser"),    #  #-----[ AFTER, ADD ]------------------------------------------  #         'L_WEBLOG_GROUP' => $lang['Group_allow_weblogs'],         'L_NO' => $lang['No'],         'S_GROUP_ALLOW_WEBLOGS_YES' => ( $group_info['group_allow_weblogs'] ) ? ' checked="checked"' ] ) ? ' checked="checked"' : '',    #  #-----[ FIND ]------------------------------------------  #         $group_moderator = isset($HTTP_POST_VARS['username']) ? $HTTP_POST_VARS['username'] : '';    #  #-----[ AFTER, ADD ]------------------------------------------  #         $group_allow_weblogs = ( isset($HTTP_POST_VARS['group_allow_weblogs']) ) ? intval($HTTP_POST_VARS['group_allow_weblogs'])    : 0;    #  #-----[ FIND ]------------------------------------------  #            $sql = "UPDATE " . GROUPS_TABLE . "               SET group_type = $group_type, group_name = '" . str_replace("'", "''", $group_name) . "', group_description = '" . str_replace("'", "''", $group_description) . "', group_moderator = $group_moderator    #  #-----[ IN-LINE FIND ]------------------------------------------  #  , group_moderator = $group_moderator    #  #-----[ IN-LINE AFTER, ADD ]------------------------------------------  #  , group_allow_weblogs = $group_allow_weblogs    #  #-----[ FIND ]------------------------------------------  #            $sql = "INSERT INTO " . GROUPS_TABLE . " (group_type, group_name, group_description, group_moderator, group_single_user)    #  #-----[ IN-LINE FIND ]------------------------------------------  #  , group_single_user    #  #-----[ IN-LINE AFTER, ADD ]------------------------------------------  #  , group_allow_weblogs    #  #-----[ FIND ]------------------------------------------  #               VALUES ($group_type, '" . str_replace("'", "''", $group_name) . "', '" . str_replace("'", "''", $group_description) . "', $group_moderator,   '0')";    #  #-----[ IN-LINE FIND ]------------------------------------------  #  $group_count_enable',   '0'    #  #-----[ IN-LINE AFTER, ADD ]------------------------------------------  #  , $group_allow_weblogs  


Let me know if you find anything.
Last edited by Dragonsys on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Image
User avatar
Dragonsys
Sr Integra Member
Sr Integra Member
 
Posts: 326
Likes: 0 post
Liked in: 0 post
Joined: Mon Apr 10, 2006 6:45 am
Cash on hand: 0.00
Location: Springtown, TX

PostAuthor: napukjon » Tue Apr 25, 2006 6:39 am

Yeah, i went over the file, and everything seems to be in the right place....
Last edited by napukjon on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http]NaPUK - Finding the Truth behind the Legends of England, Scotland and Wales![/url]

napukjon
Members
Members
 
Posts: 83
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:54 am
Cash on hand: 0.00

PostAuthor: Dragonsys » Tue Apr 25, 2006 6:51 am

"napukjon";p="3024" wrote:Yeah, i went over the file, and everything seems to be in the right place....


Can you PM me a copy of your admin_groups.php file? Never hurts to have a second pair of eyes look at it <img>
Last edited by Dragonsys on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Image
User avatar
Dragonsys
Sr Integra Member
Sr Integra Member
 
Posts: 326
Likes: 0 post
Liked in: 0 post
Joined: Mon Apr 10, 2006 6:45 am
Cash on hand: 0.00
Location: Springtown, TX

PostAuthor: napukjon » Tue Apr 25, 2006 7:14 am

Ok will do <img>
Last edited by napukjon on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http]NaPUK - Finding the Truth behind the Legends of England, Scotland and Wales![/url]

napukjon
Members
Members
 
Posts: 83
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 1:54 am
Cash on hand: 0.00

PreviousNext

Return to Mods/Hacks

Who is online

Registered users: Google [Bot], Vendethiel

cron