Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Showing category headlines
Goto page 1, 2  Next
 
Reply to topic    Forum Index » Help View previous topic
View next topic
Showing category headlines
Author Message
nolikewise



Joined: 17 Dec 2007
Posts: 51

Post Showing category headlines Reply with quote
Hi all, I am having trouble to show category links. I don't want to click on a category to show its content. But i want the headlines of
a category be shown in my somall boxes, as you can see on given picture.

please look at the pic and try to get what i want to tell...

I use the code below to show category links but there is something wrong.
Code:

$number = 7;

$category = "1";

include $cutepath.'/show_news.php';



I think "include $cutepath.'/show_news.php';" should be used in center area to show content. When i add this code to show headlines of category in my small boxes, it tries to show fullnews in small boxes and it is an error.

I read the readme file, especially these parts

------------------------------------
cn_category():

cn_category([prefix [, template [, no_prefix [, level [, id]]]]])
- prefix it's that, what will be before template, but, will be constantly repeated. Default prefix -   (empty symbol).
- no-prefix it is important thing. It directs script to make prefix for categories-parents from which begins all subcategories (default true, no - it means not to apply to prefix).
- template - as in cn_archive() its appearance. Tags:
{id} - its ID of category,
{name} - its name,
{url} - its URL (in translit or called in field "Alternative Url"),
{icon} - its icon of category.
You can put [php]some php function here[/php]. For example: <a href="[php]cute_get_link($row, category)[/php]">{name} ([php]count_category_entry({id})[/php])</a><br />. level says which category id you want show. Script will show all subcategories of typed ID. id - it needs only for cache

and...

Functions
Finally some words about usefull functions in CuteNews.RU

category_get_tree([prefix [, template [, no-prefix [, id]]]]) - this function is very similar to cn_category() described above. So we have cn_category() + tag {prefix}, which allows you to use typed prefix in template. Id is the id of the category-parent

category_get_link(id) - Id is the number of the category. The function returns a link with all parent categories

category_get_children(id) - returns a list of all child categories ("1,2,3")

category_get_title(id [, separator]) - returns the name of a category from its id. separator is the character between the names of the categories

category_get_id(category) - this function gives the id of a category from its name or URL. category - the name of a category or its URL

Good luck!
--------------------------------------------------------------------

But i couldn't see any example to show cat links. I tried many times but in vain.

And lastly, i am satisfied with Ajax news pagination but it ruins charset, my turkish characters are shown wrong but if Ajax news pagination is disabled, all is ok.
How can i prevent this?

Waiting for your solutions...
Pls download the attached pic. and give me some solution...

Nowadays i am translating cnr into Turkish, I'll send you the lang pack. Thanks a lot....



cnr.jpg
 Description:

Download
 Filename:  cnr.jpg
 Filesize:  105.39 KB
 Downloaded:  16 Time(s)

Tue Jul 08, 2008 8:24 am View user's profile Send private message
Guest








Please login to hide the ads.

Disharmony



Joined: 05 Jun 2008
Posts: 44

Post Reply with quote
First, you need to make a template that would be used to list your headlines. On my site my template is called "Headlines" and on Active News part I have this:

Code:
<a href="{link=home/post}">{sTitle|22}</a><br />


Take note that I have RUFUS turned on (hence home/post) and title truncation to shorten the title to 22 characters and not overlap the boxes.

Then it's all a matter of putting php includes and replacing $category with the corresponding ID.

Code:
<?PHP
$static = TRUE;
$category = '2';
$template = 'Headlines';
include $cutepath.'/show_news.php';
?>

Tue Jul 08, 2008 9:03 am View user's profile Send private message
nolikewise



Joined: 17 Dec 2007
Posts: 51

Post Reply with quote
My RUFUS turned off, so what is the exact code i need to show my cat headlines?

Waiting for your reply...

Have you got any idea about ajax pagination char problem?
Tue Jul 08, 2008 9:19 am View user's profile Send private message
Disharmony



Joined: 05 Jun 2008
Posts: 44

Post Reply with quote
[full-link]{title}[/full-link]
Tue Jul 08, 2008 9:30 am View user's profile Send private message
nolikewise



Joined: 17 Dec 2007
Posts: 51

Post Reply with quote
I couldn't do what i want, can you pls tell me what i have to do step by step.

Category headlines are very important for me.

Thank you...
Tue Jul 08, 2008 7:08 pm View user's profile Send private message
Mystic2010



Joined: 10 Jan 2007
Posts: 48

Post Reply with quote
Think he forgot <a href="home/post">
So it would be:
Code:
[full-link]<a href="home/post">{title}</a>[/full-link]

Tue Jul 08, 2008 7:28 pm View user's profile Send private message
nolikewise



Joined: 17 Dec 2007
Posts: 51

Post Reply with quote
Mystic2010 wrote:
Think he forgot <a href="home/post">
So it would be:
Code:
[full-link]<a href="home/post">{title}</a>[/full-link]


Thanks for the reply, but where should i put the id of cat, and i can show only desired cat.

if you suggest me, to prepare a template and put the code in it and call the template like this:

Code:
    <?PHP
$static = TRUE;
$category = '2';
$template = 'MY_TEMPLATE';
include $cutepath.'/show_news.php';
?>




if i use this code in my small boxes on the right and left sides, there exists a problem... When i clicked on headline of an article full story shows in center and in small box there is a "POST NOT FOUND" this is logical, because
Code:
 include $cutepath.'/show_news.php';
should be used only once I think. If i use this line more than one place, it ruins.

So there must be another way to show cat headlines.

If you could show cat headlines healthily, pls let me know step by step. I will try and feedback.[/code]
Tue Jul 08, 2008 7:51 pm View user's profile Send private message
Mystic2010



Joined: 10 Jan 2007
Posts: 48

Post Reply with quote
Apparently Disharmony is using $static = true which isn't relevant anymore for CNR

Instead you should do like this:
Say I have 1 main content part and 1 sidebar on the right.

Main news include would be
Code:
<?php
$template = 'YourTemplate';
$number = 'YourNumber';
$category = 'YourCategory';
include $cutepath.'/show_news.php';
?>


Now the important part, your sidebar should have:
Code:
<?php
$static['template'] = 'YourTemplate';
$static['number'] = 'YourNumber';
$static['category'] = 'YourCategory';
include $cutepath.'/show_news.php';
?>


The sidebar part should be repeated if having more sidebars.
Tue Jul 08, 2008 11:10 pm View user's profile Send private message
nolikewise



Joined: 17 Dec 2007
Posts: 51

Post Reply with quote
that is what i need, thank you so much...
Thu Jul 10, 2008 6:15 pm View user's profile Send private message
nolikewise



Joined: 17 Dec 2007
Posts: 51

Post Reply with quote
nolikewise wrote:
that is what i need, thank you so much...


My happiness did not take so long.

Now there is a dishormany between cn_category and category.

When i use this code below:
Code:

<?php
$static['template'] = 'YourTemplate';
$static['number'] = 'YourNumber';
$static['category'] = 'YourCategory';
include $cutepath.'/show_news.php';
?>


The user list and category do not function properly. When i click categories above i can see the categories listed but when i clicked on it i cannot see content. At the same time when i click on users i can see user list but when i click on a user i cannot see user info.

I think there is someting important problem. Because i tried official example and result is the same. That means my own cnr has no problem.

Waiting for your help...
Fri Jul 11, 2008 12:04 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2683
Location: Germany

Post Reply with quote
Please post your complete include code(s).
Fri Jul 18, 2008 10:38 am View user's profile Send private message
nolikewise



Joined: 17 Dec 2007
Posts: 51

Post Reply with quote
FI-DD wrote:
Please post your complete include code(s).



Code:
<?php
include 'head.php';


// pgt start
$pgt = new microTimer;
$pgt->start();
// end pgt start

$header = array(
        'users'    => 'Users',
        'search'    => 'Search',
        'category' => 'Categories',
        'archives'  => 'Archives',
);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta name="keywords" content="">
<meta name="description" content="">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link href="<?=$config_http_script_dir; ?>/theme/ferostyle.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?=cute_get_link(array(), 'feed', 'rss'); ?>">
<title>
<?=cn_title(' &laquo; ', true); ?>
</title>
<script type="text/javascript" src="<?=$config_http_script_dir; ?>/plugins/ajaxnewspagination/ajaxnewspagination.js"></script>
<script type="text/javascript" src="<?=$config_http_script_dir; ?>/plugins/rating/star.js"></script>
<link href="<?=$config_http_script_dir; ?>/plugins/rating/star.css" rel="stylesheet" type="text/css" media="screen" />
</head>

<body >
<?php include("header.html"); ?>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<!-- [+] left block area -->
   <td width="160" valign="top">
    <div>
      <?php include("sol_menu.html"); ?>
</div>
   </td>
<!-- [-] left block area -->

   <td width="5"><img src="<?=$config_http_script_dir; ?>/images/spacer.gif" alt="" width="5" height="30" /></td>

<!-- [+] center block area -->
   <td valign="top">
<div align="center" style="font-size:12pt; font-family:Verdana, Arial, Helvetica, sans-serif;">


  <?php
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ????ğ???, ??? ?????????
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
if ($do == 'search'){
   include $cutepath.'/search.php';
} elseif ($do == 'users'){
   $bgcolor = '#f7f7f7';
   include $cutepath.'/show_users.php';
} elseif ($do == 'category' and !$category){
   echo cn_category();
} elseif ($do == 'archives'){
   echo cn_archives();
} else {
echo '<div id="ajaxnews">';
$number = 3;
$random = "true";
$comments_per_page = 5;
$template = 'fero';
include $cutepath.'/show_news.php';
echo '</div>';
}
?>
</div>

   </td>
<!-- [-] center block area -->

   <td width="5"><img src="<?=$config_http_script_dir; ?>/images/spacer.gif" alt="" width="5" height="30" /></td>

<!-- [+] right block area -->
   <td width="160" valign="top">
<?php include("sag_menu.html"); ?>
   </td>
<!-- [-] right block area -->
</tr>
</table>

<table width="100%" cellspacing="0">
  <tr>
    <td>
  <?php include("footer.html"); ?>

<!-- END bottom_block_files -->
    </td>
  </tr>
</table>
</body>
</html>



this is the main file content look at center part which shows news content




Code:
   <div class="forabg" style=" font-size:12px; margin-bottom: 1px;">
   <div class="inner"><span class="corners-top"><span></span></span>
<div style="margin: 0px 0px 3px 0px;">
 <h5 style="border-bottom:solid 2px #339933; margin:0; color:#339933; font-size:13px;">
T?rk?e</h5>
 
<?php
 $static['template'] = 'Headlines';
   $static['number'] = 7;
   $static['cn_category'] = 1;
   include $cutepath.'/show_news.php';
   ?>
       <span class="corners-bottom"><span></span></span></div>
</div>
</div>   


   <div class="forabg" style=" font-size:12px; margin-bottom: 1px;">
   <div class="inner"><span class="corners-top"><span></span></span>
<div style="margin: 0px 0px 3px 0px;">
   <h5 style="border-bottom:solid 2px #339933; color:#339933; font-size:13px;">İngilizce</h5>
<?php
      echo cn_calendar()
    ?>
       <span class="corners-bottom"><span></span></span></div>
</div>
</div>


   <div class="forabg" style="margin-top: 1px; font-size:12px;">
   <div class="inner"><span class="corners-top"><span></span></span>
<div >
       <h5 style="border-bottom:solid 2px #CC33FF; color:#CC33FF; font-size:13px;">Tarih </h5>
<?php
   $static['template'] = 'Headlines';
   $static['number'] = 7;
   $static['category'] = 3;
   include $cutepath.'/show_news.php';
   ?>
       <span class="corners-bottom"><span></span></span></div>
</div>
</div> 



   <div class="forabg" style="margin-top: 1px; font-size:12px;">
   <div class="inner"><span class="corners-top"><span></span></span>
<div >   
       <h5 style="border-bottom:solid 2px #FF9900; color:#FF9900; font-size:13px;">Coğrafya </h5>
      
      <?php
   $static['template'] = 'Headlines';
   $static['number'] = 7;
   $static['category'] = 4;
   include $cutepath.'/show_news.php';
   ?>
       <span class="corners-bottom"><span></span></span></div>
</div>
</div>   



<div class="forabg" style=" font-size:12px; margin-bottom: 1px;">
   <div class="inner"><span class="corners-top"><span></span></span>
<div style="margin: 0px 0px 3px 0px;">
    <h5 style="border-bottom:solid 2px #33CCCC; color:#33CCCC; font-size:13px;"> Matematik</h5>   
<?php
   $static['template'] = 'Headlines';
   $static['number'] = 7;
   $static['category'] = 5;
   include $cutepath.'/show_news.php';
   ?>

       <span class="corners-bottom"><span></span></span></div>
</div>
</div>




<div class="forabg" style=" font-size:12px; margin-bottom: 1px;">
   <div class="inner"><span class="corners-top"><span></span></span>
<div style="margin: 0px 0px 3px 0px;">

<?php
   $static['template'] = 'Headlines';
   $static['number'] = 7;
   $static['category'] = 6;
   include $cutepath.'/show_news.php';
   ?>

       <span class="corners-bottom"><span></span></span></div>
</div>
</div>


THIS IS THE LEFT SIDE OF IT...
Sat Jul 19, 2008 12:03 pm View user's profile Send private message
nolikewise



Joined: 17 Dec 2007
Posts: 51

Post Reply with quote
FI-DD wrote:
Please post your complete include code(s).



Code:
<?php
include 'head.php';


// pgt start
$pgt = new microTimer;
$pgt->start();
// end pgt start

$header = array(
        'users'    => 'Users',
        'search'    => 'Search',
        'category' => 'Categories',
        'archives'  => 'Archives',
);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta name="keywords" content="">
<meta name="description" content="">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link href="<?=$config_http_script_dir; ?>/theme/ferostyle.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?=cute_get_link(array(), 'feed', 'rss'); ?>">
<title>
<?=cn_title(' &laquo; ', true); ?>
</title>
<script type="text/javascript" src="<?=$config_http_script_dir; ?>/plugins/ajaxnewspagination/ajaxnewspagination.js"></script>
<script type="text/javascript" src="<?=$config_http_script_dir; ?>/plugins/rating/star.js"></script>
<link href="<?=$config_http_script_dir; ?>/plugins/rating/star.css" rel="stylesheet" type="text/css" media="screen" />
</head>

<body >
<?php include("header.html"); ?>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<!-- [+] left block area -->
   <td width="160" valign="top">
    <div>
      <?php include("sol_menu.html"); ?>
</div>
   </td>
<!-- [-] left block area -->

   <td width="5"><img src="<?=$config_http_script_dir; ?>/images/spacer.gif" alt="" width="5" height="30" /></td>

<!-- [+] center block area -->
   <td valign="top">
<div align="center" style="font-size:12pt; font-family:Verdana, Arial, Helvetica, sans-serif;">


  <?php
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ????ğ???, ??? ?????????
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
if ($do == 'search'){
   include $cutepath.'/search.php';
} elseif ($do == 'users'){
   $bgcolor = '#f7f7f7';
   include $cutepath.'/show_users.php';
} elseif ($do == 'category' and !$category){
   echo cn_category();
} elseif ($do == 'archives'){
   echo cn_archives();
} else {
echo '<div id="ajaxnews">';
$number = 3;
$random = "true";
$comments_per_page = 5;
$template = 'fero';
include $cutepath.'/show_news.php';
echo '</div>';
}
?>
</div>

   </td>
<!-- [-] center block area -->

   <td width="5"><img src="<?=$config_http_script_dir; ?>/images/spacer.gif" alt="" width="5" height="30" /></td>

<!-- [+] right block area -->
   <td width="160" valign="top">
<?php include("sag_menu.html"); ?>
   </td>
<!-- [-] right block area -->
</tr>
</table>

<table width="100%" cellspacing="0">
  <tr>
    <td>
  <?php include("footer.html"); ?>

<!-- END bottom_block_files -->
    </td>
  </tr>
</table>
</body>
</html>



this is the main file content look at center part which shows news content




Code:
   <div class="forabg" style=" font-size:12px; margin-bottom: 1px;">
   <div class="inner"><span class="corners-top"><span></span></span>
<div style="margin: 0px 0px 3px 0px;">
 <h5 style="border-bottom:solid 2px #339933; margin:0; color:#339933; font-size:13px;">
T?rk?e</h5>
 
<?php
 $static['template'] = 'Headlines';
   $static['number'] = 7;
   $static['cn_category'] = 1;
   include $cutepath.'/show_news.php';
   ?>
       <span class="corners-bottom"><span></span></span></div>
</div>
</div>   


   <div class="forabg" style=" font-size:12px; margin-bottom: 1px;">
   <div class="inner"><span class="corners-top"><span></span></span>
<div style="margin: 0px 0px 3px 0px;">
   <h5 style="border-bottom:solid 2px #339933; color:#339933; font-size:13px;">İngilizce</h5>
<?php
      echo cn_calendar()
    ?>
       <span class="corners-bottom"><span></span></span></div>
</div>
</div>


   <div class="forabg" style="margin-top: 1px; font-size:12px;">
   <div class="inner"><span class="corners-top"><span></span></span>
<div >
       <h5 style="border-bottom:solid 2px #CC33FF; color:#CC33FF; font-size:13px;">Tarih </h5>
<?php
   $static['template'] = 'Headlines';
   $static['number'] = 7;
   $static['category'] = 3;
   include $cutepath.'/show_news.php';
   ?>
       <span class="corners-bottom"><span></span></span></div>
</div>
</div> 



   <div class="forabg" style="margin-top: 1px; font-size:12px;">
   <div class="inner"><span class="corners-top"><span></span></span>
<div >   
       <h5 style="border-bottom:solid 2px #FF9900; color:#FF9900; font-size:13px;">Coğrafya </h5>
      
      <?php
   $static['template'] = 'Headlines';
   $static['number'] = 7;
   $static['category'] = 4;
   include $cutepath.'/show_news.php';
   ?>
       <span class="corners-bottom"><span></span></span></div>
</div>
</div>   



<div class="forabg" style=" font-size:12px; margin-bottom: 1px;">
   <div class="inner"><span class="corners-top"><span></span></span>
<div style="margin: 0px 0px 3px 0px;">
    <h5 style="border-bottom:solid 2px #33CCCC; color:#33CCCC; font-size:13px;"> Matematik</h5>   
<?php
   $static['template'] = 'Headlines';
   $static['number'] = 7;
   $static['category'] = 5;
   include $cutepath.'/show_news.php';
   ?>

       <span class="corners-bottom"><span></span></span></div>
</div>
</div>




<div class="forabg" style=" font-size:12px; margin-bottom: 1px;">
   <div class="inner"><span class="corners-top"><span></span></span>
<div style="margin: 0px 0px 3px 0px;">

<?php
   $static['template'] = 'Headlines';
   $static['number'] = 7;
   $static['category'] = 6;
   include $cutepath.'/show_news.php';
   ?>

       <span class="corners-bottom"><span></span></span></div>
</div>
</div>


THIS IS THE LEFT SIDE OF IT...
Sat Jul 19, 2008 12:04 pm View user's profile Send private message
nolikewise



Joined: 17 Dec 2007
Posts: 51

Post Reply with quote
DOWNLOAD THE FILE BELOW



files.rar
 Description:

Download
 Filename:  files.rar
 Filesize:  2.47 KB
 Downloaded:  5 Time(s)

Sat Jul 19, 2008 12:05 pm View user's profile Send private message
nolikewise



Joined: 17 Dec 2007
Posts: 51

Post Reply with quote
oh... my god. i am sorry when i posted the code above forum did not accepted it and i tried again. Sorry for mess...

Admin pls delete unwanted messages...

Check my cnr try out: http://www.okuogren.com/yeni/
Sun Jul 20, 2008 7:20 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Help All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
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
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.