1
yasir
split the latest news block to blocks
  • 2009/7/5 20:44

  • yasir

  • Not too shy to talk

  • Posts: 109

  • Since: 2005/5/16


i want to split the news blocks to multiple blocks
such as

sports (news)
local ...........

so i wanna split the block itself
& change the query

I good PHP Dev.
so i just need some help

news_block_new.html

<ul>
  <{foreach 
item=news from=$block.stories}>
    <
li><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>"><{$news.title}>a> (<{$news.date}>)li>
  <{/foreach}>
ul>

so how should i make it multiple blocks
is it enough to put multiple copy of this file

& how should i use the create function
create_news(news_cat_id)
thank you very much

2
ghia
Re: split the latest news block to blocks
  • 2009/7/6 7:37

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


No need to do it complicated.
Clone the block as many times as needed.
Edit the block and assign the topics to display.

3
yasir
Re: split the latest news block to blocks
  • 2009/7/10 0:50

  • yasir

  • Not too shy to talk

  • Posts: 109

  • Since: 2005/5/16


thank u very much

i just wanna make sure that i understand u well

first i copy
xoops\modules\news\blocks/news_top.php
for few times

should i add somthing like?

$modversion['blocks'][4]['file'] = "news_top.php";
$modversion['blocks'][4]['name'] = _MI_NEWS_BNAME5;
$modversion['blocks'][4]['description'] = "Shows recent articles";
$modversion['blocks'][4]['show_func'] = "b_news_top_show";
$modversion['blocks'][4]['edit_func'] = "b_news_top_edit";
$modversion['blocks'][4]['options'] = "published|10|25";
$modversion['blocks'][4]['template'] = 'news_block_new.html';


to xoops_version.php

thank u again

4
yasir
Re: split the latest news block to blocks
  • 2009/7/10 3:58

  • yasir

  • Not too shy to talk

  • Posts: 109

  • Since: 2005/5/16


i have change the files
news_top.php
xoops_version.php

the files

the problem is that the customer want those 4 blocks
at the top of middle (main) section
(in table of 2 row * 2 columns)
what sould i do

5
ghia
Re: split the latest news block to blocks
  • 2009/7/10 7:11

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
i just wanna make sure that i understand u well
first i copy
No, in the block manager use the link clone (next to edit) to clone the block.
Quote:
the problem is that the customer want those 4 blocks
at the top of middle (main) section
(in table of 2 row * 2 columns)
what sould i do
Set them on position top center left and top center right

6
yasir
Re: split the latest news block to blocks
  • 2009/7/10 14:54

  • yasir

  • Not too shy to talk

  • Posts: 109

  • Since: 2005/5/16


so if i clone the block
how could i change the SQL Query of each block
<ul>
  <{foreach 
item=news from=$block.stories}>
    <
li><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>"><{$news.title}>a> (<{$news.date}>)li>
  <{/foreach}>
ul>

?!!!
i have news 1.1

Quote:
Set them on position top center left and top center right

i didn't know that the new XOOPS have mid (up / down)

thnx

7
ghia
Re: split the latest news block to blocks
  • 2009/7/10 15:58

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
how could i change the SQL Query of each block
You don't. As I said before edit the block settings and select the categories to show.
Quote:
i have news 1.1
Oops, that is very old.
You might consider an upgrade. Above possibilities are in XOOPS 2.3.3 and News 1.63.

8
yasir
Re: split the latest news block to blocks
  • 2009/7/10 18:36

  • yasir

  • Not too shy to talk

  • Posts: 109

  • Since: 2005/5/16


my mag is 2.0.18.2
but the news module is 1.1
can u proved me the
newest one link?


Quote:
select the categories to show.

i don'tthink that i have this option ?!!!!

9
sailjapan
Re: split the latest news block to blocks

here's a link to News 1.63 (check you have php 5)
Never let a man who does not believe something can be done, talk to a man that is doing it.

Login

Who's Online

405 user(s) are online (308 user(s) are browsing Support Forums)


Members: 0


Guests: 405


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits