[Solved]News Stopping / [break]: Stop News Where You Want


Subject: [Solved]News Stopping / [break]: Stop News Where You Want
Hey all!

What I would like to see, and what im missing a bit, is making the news stop showing on the front page where I want it!

On ezportal (in the old days) you had a mod named the "[break]-mod" which in short fetch'd everything untill it saw "[break]". So you don't have to fill in a number, like 400 characters, but you can typ "[break]" where you want to stop showing the news.

Example Front page news:

"Hey, I like Icy Phoenix because... [break]
"click here for the full text".

And if you click, you can see the full message, but you never see the [break] tag!
Could this be done on icy Phoenix? And someone knows how?

Thnx in advance!

EDIT: Thank you MG!

You can break any news posts on the portal page where you would like the intro to stop by using the code: just type in a post to do so.

Last edited by OwnageWorld on Mon 15 Mar, 2010 16:33; edited 2 times in total
Profile PM  
Subject: Re: News Stopping / [break]: Stop News Where You Want
try to go to CMS>>News Block and adjust numbers of characters.

Profile PM  
Subject: Re: News Stopping / [break]: Stop News Where You Want
xmenfile wrote: [View Post]
try to go to CMS>>News Block and adjust numbers of characters.

I know hehe.
But what I would like to have, is that you type a certain word, and it "breaks" the text on the portal. So on every newspost, you can decide for yourself how long it is...

Nobody knows this mod?

Profile PM  
Subject: Re: News Stopping / [break]: Stop News Where You Want
Would be nice if I could get this too.....

Profile PM  
Subject: Re: News Stopping / [break]: Stop News Where You Want
Im still definitely interested in this one.
How much would someone like to receive for making this small addon for me?
I guess someone with some knowledge about this, can make this easily! (hope so...)

Thanks in advance!

Profile PM  
Subject: Re: News Stopping / [break]: Stop News Where You Want
Please provide more details about what you need.

You just need this to be shown in News Block in home page?

Subject: Re: News Stopping / [break]: Stop News Where You Want
If I understand right, he means, that you can put a code in the first post

Like [break] or [break]Read More[/break]

So you can decide by yourself how long a portal post can be.

But than it should be unvisible in viewtopic.php ;-)
Or only <hr>

Profile PM  
Subject: Re: News Stopping / [break]: Stop News Where You Want
TheSteffen wrote: [View Post]
If I understand right, he means, that you can put a code in the first post

Like [break] or [break]Read More[/break]

So you can decide by yourself how long a portal post can be.

But than it should be unvisible in viewtopic.php ;-)
Or only <hr>

Yep, that would be exactly what I am looking for! Some post would be longer on the portal, others only need a short introduction, where they can only view the complete post if you open them.

There was such a mod for ezportal (can not find it anymore on the WWW :( ), but it was inserted as an BBCode, to break post where you want them. It would be invisible if you read the post using the portal, and it would be invisible in viewtopic.php .
I think/ hope you would make a lot of people happy with this one. I definitely would!

Greets!

Profile PM  
Subject: Re: News Stopping / [break]: Stop News Where You Want
I have found something like this in the code... you can try, but I'm not assuring that it will work:

Code: [Download] [Hide] [Select]
<!--break-->


Have a try in inserting this.

Subject: Re: News Stopping / [break]: Stop News Where You Want
Mighty Gorgon wrote: [View Post]
I have found something like this in the code... you can try, but I'm not assuring that it will work:

Code: [Download] [Hide] [Select]
<!--break-->


Have a try in inserting this.

Thank you! This worked!

The only problem is that it is shown in "search" and in "forum post"...":)
Could this be solved too?

Profile PM  
Subject: Re: [Solved]News Stopping / [break]: Stop News Where You Want
I may have a look at it some time in the future, but I'm not assuring that.

Subject: Re: [Solved]News Stopping / [break]: Stop News Where You Want
Mighty Gorgon wrote: [View Post]
I may have a look at it some time in the future, but I'm not assuring that.

Do you, or anybody else, know how this can be solved?
The break tag works!

But now you always see "<!--break-->" in every post. You cant make it smaller text or a white text because you will see a half BBcode on the portal page. The word can not be replaced, because then it does not work...

Example 1 in viewtopic on forum after the first picture, but also if you use "search" with more characters, you will see it...
On portal view the <!--break--> tag is gone! :) (as it should be...)

Someone else knows some tricks to get around this <!--break--> tag in a topic? Could it be filtered when someone views the message in topicview?

Thanks in advance!

Profile PM  
Subject: Re: [Solved]News Stopping / [break]: Stop News Where You Want
Try something like this in viewtopic:
Code: [Download] [Hide] [Select]
$message = str_replace('<!--break-->', '', $message);


Maybe just after this line:
Code: [Download] [Hide] [Select]
$message = $postrow[$i]['post_text'];

Subject: Re: [Solved]News Stopping / [break]: Stop News Where You Want
Mighty Gorgon wrote: [View Post]
Try something like this in viewtopic:
Code: [Download] [Hide] [Select]
$message = str_replace('<!--break-->', '', $message);


Maybe just after this line:
Code: [Download] [Hide] [Select]
$message = $postrow[$i]['post_text'];

Hey MG,

Thank you for the response! Too bad this did not work...
But somewhere under the suggested code I found these lines already in the coding (on viewtopic.php)....
Code: [Download] [Hide] [Select]

// BEGIN CMX News Mod
// Strip out the <!--break--> delimiter.
$delim = htmlspecialchars('<!--break-->');
$pos = strpos($message, $delim);
if(($pos !== false) && ($pos < strlen($message)))
{
$message = substr_replace($message, html_entity_decode($delim), $pos, strlen($delim));
}

// END CMX News Mod

This is located under the postrow code line.

Someone knows why this is not working? Why the break tag is not stripped out?

Thanks in advance!

Profile PM  
Subject: Re: [Solved]News Stopping / [break]: Stop News Where You Want
Move the code after highlight, so you will have something like this:

Code: [Download] [Hide] [Select]
// Highlight active words (primarily for search)
if ($highlight_match)
{
// This has been back-ported from 3.0 CVS
$message = preg_replace('#(?!<.*)(?<!\w)(' . $highlight_match . ')(?!\w|[^<>]*>)#i', '<span class="highlight-w"><b>> $message = preg_replace('#(?!<.*)(?<!\w)(' . $highlight_match . ')(?!\w|[^<>]*>)#i', '<span class="highlight-w"><b>\1</b></span>', $message);<</b></span>', $message);
}

// BEGIN CMX News Mod
// Strip out the <!--break--> delimiter.
$delim = htmlspecialchars('<!--break-->');
$pos = strpos($message, $delim);
if(($pos !== false) && ($pos < strlen($message)))
{
$message = substr_replace($message, html_entity_decode($delim), $pos, strlen($delim));
}
// END CMX News Mod


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.2083s (PHP: 11% SQL: 89%)
SQL queries: 14 - Debug Off - GZIP Enabled