Home  | FAQ  | Search  | Memberlist  | Usergroups  | Register  | Profile  | Log in  | Log in for your private messages
How do I make it so it organizes by category?
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    myWebland Forum Index -> Customization
View previous topic :: View next topic  
Author Message
dawgpound77
Newbie


Joined: 23 Jun 2005
Posts: 19

PostPosted: Mon Jun 27, 2005 3:57 pm    Post subject: Reply with quote

sean wrote:
post your script here please


index.php

<?

// Blog Script - File Name : index.php
// Copyright (C) myBloggie Sean
// http://www.mywebland.com , http://mybloggie.mywebland.com

// You are requested to retain this copyright notice in order to use
// this software.


//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.

//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

//error_reporting('E_ALL');
define('IN_MYBLOGGIE', true);

session_start();

$mybloggie_root_path = './';

include_once($mybloggie_root_path.'config.php');
include_once($mybloggie_root_path.'includes/db.php');
include_once($mybloggie_root_path.'includes/template.php');
include_once($mybloggie_root_path.'includes/function.php');
include_once($mybloggie_root_path.'language/'.$language);

$template = new Template('./templates/'.$style.'/') ;

$template->set_filenames(array(
'blog_header' => 'blog_header.tpl',
'sidevert' => 'sidevert.tpl',
'blog_body' => 'blog_body.tpl',
'footer' => 'footer.tpl',
// myBloggie 2.1.2
'syndication' => 'syndication.tpl',
));

$template->assign_vars(array(
'CHAR_SET' => $charset,
'CONTENT_DIRECTION' => $content_direction,
'OWNER' => '<a class="menu" href="http://internal.engeo.com">internal.engeo.com</a>',
'STYLE' => $style,
'TIME' => 'Time [GMT '.$sign.$timezone.'] :'.gmtdate('d M , h:i:s a', time(), $timezone ),
// Added for myBloggie 2.1.2
'BLOG_NAME' => $myblogname,
'SYNDICATION' => $lang['Syndication'],
'RSS_URL' => self_url()."/rss/rss.php",
'RSS2_URL' => self_url()."/rss/rss2.php" ,
'BGCOLOR' => $blogbgcolor,
'BLOGGIE_PATH' => $mybloggie_root_path ,
'PINGBACK_SVR' => self_url()."/pingserver/pingsvr.php" ,

));



if(isset($_SESSION['username']) && isset($_SESSION['passwd']))
{
$template->assign_vars(array(
'ADMIN_MENU' => '<center><span class="menuitem"><b><a class="std" href="./admin.php">Admin CP</a></b><span></center>',
));
}


// Left Right side menu switch

if (!isset($mode)) { $search = true ; }
if ($right_menu){
$template->assign_block_vars('rightsidemenu', array( ));
}
else {
$template->assign_block_vars('leftsidemenu', array( ));
}

$template->pparse('blog_header');

$search = true ;
if (isset($_GET['mode'])) $mode=$_GET['mode'];

// if sidemenu is set on the right ==> $right_menu = true; in config.php
if ($right_menu){
if (isset($mode)) {
switch ($mode) {
case "viewid":
include 'view.php';
$search = false ;
break;
case "viewdate" :
include 'viewmode.php';
break;
case "viewmonth":
include 'viewmode.php';
break;
case "delcom":
include 'delcomment.php';
$search = false ;
break;
case "editcom":
include 'view.php';
$search = false ;
break;
case "viewcat":
include 'viewmode.php';
break;
case "search":
include 'search.php';
break;
case "search":
include 'search.php';
break;
default: include($mybloggie_root_path.'categorybody.php'); break;
}
}
if (!isset($mode)) {
include($mybloggie_root_path.'categorybody.php');
}
$template->pparse('sidevert');
}

// End right sidemenu condition

// Sidemenu menu items. You can change the menu item order here
include($mybloggie_root_path.'calendar.php');
include($mybloggie_root_path.'spacer.php');
include($mybloggie_root_path.'category.php');
include($mybloggie_root_path.'spacer.php');
include($mybloggie_root_path.'archives.php');
include($mybloggie_root_path.'spacer.php');
if ($search) {
include($mybloggie_root_path.'searchform.php');
include($mybloggie_root_path.'spacer.php');
}
$template->pparse('syndication');
// End sidemenu menu items

// if sidemenu is set on the left ==> $right_menu = false; in config.php
if (!$right_menu){

$template->pparse('sidevert');
if (isset($mode)) {
switch ($mode) {
case "viewid":
include 'view.php';
$search = false ;
break;
case "viewdate" :
include 'viewmode.php';
break;
case "viewmonth":
include 'viewmode.php';
break;
case "delcom":
include 'delcomment.php';
$search = false ;
break;
case "editcom":
include 'view.php';
$search = false ;
break;
case "viewcat":
include 'viewmode.php';
break;
case "search":
include 'search.php';
break;
case "search":
include 'search.php';
break;
default: include($mybloggie_root_path.'categorybody.php'); break;
}
}
if (!isset($mode)) {
include($mybloggie_root_path.'categorybody.php');
}
}
// End left sidemenu condition

$template->pparse('footer');

?>

categorybody.php

<?

// Blog Script - File Name : categorybody.php
// Copyright (C) myBloggie Sean
// http://www.mywebland.com , http://mybloggie.mywebland.com

// You are requested to retain this copyright notice in order to use
// this software.


//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.

//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

if ( !defined('IN_MYBLOGGIE') )
{
die("You are not allowed to access this page directly !");
}

$sql= "SELECT DISTINCT ".POST_TBL.".cat_id AS c, ".CAT_TBL.".cat_id, ".CAT_TBL.".cat_desc, COUNT( 'c' ) as z
FROM ".POST_TBL.", ".CAT_TBL."
WHERE ".POST_TBL.".cat_id = ".CAT_TBL.".cat_id
GROUP BY c
ORDER BY ".CAT_TBL.".cat_desc ASC"
;

$result = $db->sql_query($sql) ;

$template->set_filenames(array(
'categories' => 'categoriesbody.tpl',
));
$template->assign_vars(array(
'CATEGORIES' => $lang['Categories'],
));
while ($categories = $db->sql_fetchrow($result)) {

$template->assign_block_vars('categories', array(
'MTH' => $categories['cat_desc'],
'POSTS' => $categories['z'],
'U_ARCHIVE' => $_SERVER['PHP_SELF']."?mode=viewcat&amp;cat_id=".$categories['cat_id'],
)
);
//echo $archive['m']." ".$archive['t'];
}

$template->pparse('categories');

?>

categoriesbody.tpl

<table width="100%" border="0" cellpadding="1" cellspacing="2">
<tr>
<td class="header" colspan="3">{CATEGORIES}</td>
</tr>
<!-- BEGIN categories -->
<tr>
<td class="smallbullet" width="14" valign="top"></td><td class="recent"><a class="std" href="{categories.U_ARCHIVE}">{categories.MTH}</a></td><td class="count" width="25%">[{categories.POSTS}]</td>
</tr>
<!-- END categoriese -->
</table>


THANKS Embarassed
Back to top
View user's profile Send private message
sean
Site Admin


Joined: 14 Jul 2004
Posts: 671

PostPosted: Mon Jun 27, 2005 4:31 pm    Post subject: Reply with quote

copy this categoriesbody.tpl & test it out.. i didnt test it...

<table width="100%" border="0" cellpadding="1" cellspacing="2">
<tr>
<td class="header" colspan="3">{CATEGORIES}</td>
</tr>
<!-- BEGIN categories -->
<tr>
<td class="smallbullet" width="14" valign="top"></td><td class="recent"><a class="std" href="{categories.U_ARCHIVE}">{categories.MTH}</a></td><td class="count" width="25%">[{categories.POSTS}]</td>
</tr>
<!-- END categories -->
</table>
Back to top
View user's profile Send private message Send e-mail
dawgpound77
Newbie


Joined: 23 Jun 2005
Posts: 19

PostPosted: Mon Jun 27, 2005 4:58 pm    Post subject: Reply with quote

that is the same thing I already have in the categoriesbody.tpl...I copied and paste it to the document.

I am still getting the same results.

This is in the body:
Categories
Computer Tips [1]
ENGEO Events [2]
The Insider [1]

And this is on the menu to the right:

Categories
Computer Tips [1]
ENGEO Events [2]
The Insider [1]
Computer Tips [1]
ENGEO Events [2]
The Insider [1]

And it should be the same as the body. It works when I go to the view the categories say ENGEO Events. It shows the two events in the body and then on right side where the menu is it looks correct...it looks like this:

Categories
Computer Tips [1]
ENGEO Events [2]
The Insider [1]

That is how I would like it to appear when viewing the index page with the same number of categories in the body as there are in the menu on the right. thanks
Back to top
View user's profile Send private message
dawgpound77
Newbie


Joined: 23 Jun 2005
Posts: 19

PostPosted: Mon Jun 27, 2005 9:34 pm    Post subject: Thanks for helping me out Sean...i really appreciate it... Reply with quote

I went ahead and upgraded to the 2.1.3 beta version. I have it set all set up and it looks great...but I am still having the same problem of the Categories double only on the index.php page in the menu. I tried the other edits you suggested for the 2.1.2 and still get the same results.

Is there a method I am supposed to remove somewhere...thanks again and sorry to be a pain. Embarassed
Back to top
View user's profile Send private message
sean
Site Admin


Joined: 14 Jul 2004
Posts: 671

PostPosted: Tue Jun 28, 2005 1:53 pm    Post subject: Reply with quote

in categorybody.php try this

Code:
<?

// Blog Script - File Name : categorybody.php
// Copyright (C) myBloggie Sean
// http://www.mywebland.com , http://mybloggie.mywebland.com

// You are requested to retain this copyright notice in order to use
// this software.


//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.

//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

if ( !defined('IN_MYBLOGGIE') )
{
die("You are not allowed to access this page directly !");
}

$sql= "SELECT DISTINCT ".POST_TBL.".cat_id AS c, ".CAT_TBL.".cat_id, ".CAT_TBL.".cat_desc, COUNT( 'c' ) as z
FROM ".POST_TBL.", ".CAT_TBL."
WHERE ".POST_TBL.".cat_id = ".CAT_TBL.".cat_id
GROUP BY c
ORDER BY ".CAT_TBL.".cat_desc ASC"
;

$result = $db->sql_query($sql) ;

$template->set_filenames(array(
'categoriesbody' => 'categoriesbody.tpl',
));
$template->assign_vars(array(
'CATEGORIES' => $lang['Categories'],
));
while ($categories = $db->sql_fetchrow($result)) {

$template->assign_block_vars('categories', array(
'MTH' => $categories['cat_desc'],
'POSTS' => $categories['z'],
'U_ARCHIVE' => $_SERVER['PHP_SELF']."?mode=viewcat&amp;cat_id=".$categories['cat_id'],
)
);
//echo $archive['m']." ".$archive['t'];
}

$template->pparse('categoriesbody');

?>
Back to top
View user's profile Send private message Send e-mail
dawgpound77
Newbie


Joined: 23 Jun 2005
Posts: 19

PostPosted: Tue Jun 28, 2005 2:07 pm    Post subject: That worked for the right side menu, but now I get this when Reply with quote

That worked for the right side menu, but now I get this when viewing the index.php Arrow

Parse error: parse error, unexpected '<'in /var/www/intranet/blog/categorybody.php on line 3


Thanks
Back to top
View user's profile Send private message
dawgpound77
Newbie


Joined: 23 Jun 2005
Posts: 19

PostPosted: Tue Jun 28, 2005 2:11 pm    Post subject: I am an idiot Reply with quote

Embarassed

I don't get the error now...I made a mistake but it still is doubling on the menu side on index.php. Not sure what to do now.

I really appreciate all your help. this is a great script and great support.

Thanks
Back to top
View user's profile Send private message
sean
Site Admin


Joined: 14 Jul 2004
Posts: 671

PostPosted: Tue Jun 28, 2005 2:59 pm    Post subject: Reply with quote

Send the all the files to me & easier for me to trouble shoot
Back to top
View user's profile Send private message Send e-mail
dawgpound77
Newbie


Joined: 23 Jun 2005
Posts: 19

PostPosted: Tue Jun 28, 2005 3:40 pm    Post subject: Reply with quote

I sent the whole blog compressed about 20 minutes ago. If that did not work please let me know and i can try again and maybe only send the three files you need.

Thanks
Back to top
View user's profile Send private message
sean
Site Admin


Joined: 14 Jul 2004
Posts: 671

PostPosted: Wed Jun 29, 2005 5:57 am    Post subject: Reply with quote

Please check your email...
Back to top
View user's profile Send private message Send e-mail
dawgpound77
Newbie


Joined: 23 Jun 2005
Posts: 19

PostPosted: Wed Jun 29, 2005 1:59 pm    Post subject: Reply with quote

Thanks! that is so awesome! Laughing
Back to top
View user's profile Send private message
NewBlog
Newbie


Joined: 29 May 2006
Posts: 9

PostPosted: Mon May 29, 2006 6:31 am    Post subject: Please post here Reply with quote

Hey sean,

I am using myBloggie 2.1.3 and want to display the Category Page instead of Index.php

What changes should I made? Can you please post the script here what you mail to dawgpound77 but I am using 2.1.3 version.

Thanks
Back to top
View user's profile Send private message
sean
Site Admin


Joined: 14 Jul 2004
Posts: 671

PostPosted: Wed May 31, 2006 1:12 pm    Post subject: Reply with quote

It was a year ago. I dont have the file with me right now.
Please tell me specifically what to you want to display on the category page?
if the same

This is what you need to do
1)

DELETE THIS

if ( !defined('IN_MYBLOGGIE') )
{
die("You are not allowed to access this page directly !");
}


add THIS ON TO REPLACE THE ABOVE.
$mybloggie_root_path = './';

include_once($mybloggie_root_path.'config.php');
include_once($mybloggie_root_path.'includes/db.php');
include_once($mybloggie_root_path.'includes/template.php');
include_once($mybloggie_root_path.'includes/function.php');
include_once($mybloggie_root_path.'language/'.$language);


$template = new Template('./templates/'.$style.'/') ;
Back to top
View user's profile Send private message Send e-mail
NewBlog
Newbie


Joined: 29 May 2006
Posts: 9

PostPosted: Wed May 31, 2006 2:39 pm    Post subject: Reply with quote

sean wrote:
It was a year ago. I dont have the file with me right now.
Please tell me specifically what to you want to display on the category page?
if the same

This is what you need to do
1)

DELETE THIS

if ( !defined('IN_MYBLOGGIE') )
{
die("You are not allowed to access this page directly !");
}


add THIS ON TO REPLACE THE ABOVE.
$mybloggie_root_path = './';

include_once($mybloggie_root_path.'config.php');
include_once($mybloggie_root_path.'includes/db.php');
include_once($mybloggie_root_path.'includes/template.php');
include_once($mybloggie_root_path.'includes/function.php');
include_once($mybloggie_root_path.'language/'.$language);


$template = new Template('./templates/'.$style.'/') ;


Thanks Sean,

Sorry for dumb question.

In which file I should make above changes?
Back to top
View user's profile Send private message
sean
Site Admin


Joined: 14 Jul 2004
Posts: 671

PostPosted: Wed May 31, 2006 3:19 pm    Post subject: Reply with quote

category.php of course
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    myWebland Forum Index -> Customization All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
TNX?

Error. Page cannot be displayed. Please contact your service provider for more details. (6)




Powered by phpBB © 2001, 2005 phpBB Group
Contact Us