WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Code Snippet: Display news items, anywhere
  • Print
Pages: 1 ... 4 5 [6] 7 8 ... 21   Go Down

Author Topic: Code Snippet: Display news items, anywhere  (Read 372573 times)

Offline pszilard

  • Posts: 75
  • Gender: Male
    • RemekTek
Re: Code Snippet: Display news items, anywhere
« Reply #125 on: December 26, 2007, 08:01:22 PM »
Dear Argos,

Where can I find instructions for using GHTML menus with WB? I have bought a license for it years ago, and would love to make use of it in WB!

Thnx,
Logged
Paul Szilard
WB user since Dec 2007:
http://www.remektek.com.au/wb
http://photos.remektek.com.au/ for my photo portfolio

Offline pszilard

  • Posts: 75
  • Gender: Male
    • RemekTek
Re: Code Snippet: Display news items, anywhere
« Reply #126 on: December 26, 2007, 08:08:35 PM »
When I try to use the News snipet and save, I get the following:

Quote
Not Implemented
The page you are looking for cannot be displayed because a header value in the request does not match certain configuration settings on the Web server.

This message also raises it ugly head at other times. Any clues what is going on here???

ps: this is an error 501
« Last Edit: December 26, 2007, 08:10:52 PM by pszilard »
Logged
Paul Szilard
WB user since Dec 2007:
http://www.remektek.com.au/wb
http://photos.remektek.com.au/ for my photo portfolio

Offline marathoner

  • Posts: 495
Re: Code Snippet: Display news items, anywhere
« Reply #127 on: December 26, 2007, 10:40:01 PM »
You didn't provide very much information. Are you using the snippet in a template or in a code section?

A 501 is "Not Implemented"...could it be that you are trying to use a service not supported by your host? You say that you get a 501 at other times...what other times?
Logged

Offline babsy

  • Posts: 337
Re: Code Snippet: Display news items, anywhere
« Reply #128 on: January 02, 2008, 07:52:33 PM »
hi again  :-) it works fine here, but i have one question!

i have just installed it on an old webpage i had, but when i install it, it just says, "update successful" but it doesn´t show up when i look through my modules?? then i went in to my ftp to just delete it... but it wont allow me to delete, and i can´t un-install it, because it doesn´t show up on my add-ons list  :? any ideas?
Logged

Offline ruebenwurzel

  • Betatester
  • **
  • Posts: 8544
  • Gender: Male
  • Keep on Rockin
    • Familie Gallas Online
Re: Code Snippet: Display news items, anywhere
« Reply #129 on: January 02, 2008, 09:33:00 PM »
Hello,

Quote
on an old webpage

Wich WB version is running there. Code snippets are only supported from 2.6.5 and higher.

Cause the permissions please look on our help page. There is all explained.

Matthias
Logged

Offline babsy

  • Posts: 337
Re: Code Snippet: Display news items, anywhere
« Reply #130 on: February 11, 2008, 01:48:32 PM »
Hi ...

it works fine.. i have updatet wb...

Its a great module... :-D

but its still bugging me that the "line" under the text is overlapping if i have a picture in the small text.... the line "jumbs around"..... and it doesn´t look nice.... and the only solution i can figure out it so "enter" until it looks nice, but thats not a very smart solution... so  :?

i have tried to change it, but no luck, so if anyone has a solution, please post it here!! :?
Logged

dbrorlando

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #131 on: February 12, 2008, 07:24:18 PM »
I've used news anywhere several times, but I need to use it for a specific layout which includes the "published date", "news title" and "display name".  Can someone please help me?... I've spent most of the past few days trying to make it work.  I did find the post showing how to add the date, and was able to change it to show the published date, but when I add multiple news items, the dates don't display correctly.

Here's an example of what I'm looking for:

 02.12.2008 - Name of Article - Author's Display Name
 02.11.2008 - News Title Here - Author's Display Name
Logged

Offline diodak

  • Posts: 85
Re: Code Snippet: Display news items, anywhere
« Reply #132 on: March 15, 2008, 09:03:07 AM »
Quote from: dbrorlando on February 12, 2008, 07:24:18 PM
I've used news anywhere several times, but I need to use it for a specific layout which includes the "published date", "news title" and "display name".  Can someone please help me?... I've spent most of the past few days trying to make it work.  I did find the post showing how to add the date, and was able to change it to show the published date, but when I add multiple news items, the dates don't display correctly.

Here's an example of what I'm looking for:

 02.12.2008 - Name of Article - Author's Display Name
 02.11.2008 - News Title Here - Author's Display Name

I dont know what method you are using, try mine:

Code: [Select]
if ($data['posted_when'] != "") {
$output .= "<div class=\"any-date\">".date("M d, Y",$data['posted_when'])."</div>\n";

near line 108 in include.php
Logged
Buchsbaum

falkena

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #133 on: March 16, 2008, 10:26:17 PM »
Hallo,
I have installed the new wb 2.7.
with the new news module i can put an start date an end dat to the news.
the problem is that anynews wil show it anyway.
Is there a way to fix this?
Logged

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: Code Snippet: Display news items, anywhere
« Reply #134 on: March 16, 2008, 11:04:52 PM »
The anynews snipet was not written for this functionality (checking the on and off times). it will need to be rewritten for that purpose.

cheers

Klaus
Logged

Offline marathoner

  • Posts: 495
Re: Code Snippet: Display news items, anywhere
« Reply #135 on: March 18, 2008, 02:06:07 AM »
The snippet allows you to customize the output any way you want on any page you want. It's simply a tool to extract fields from the news table. In order to be 'aware' of the start/end date you will need to customize the output to do this (just like someone may want to ignore the start/end date). Simply modify the query to only extract those records that fit your criteria and then display whichever fields you want in whatever way you want.
Logged

spida

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #136 on: April 07, 2008, 01:34:22 PM »
Quote from: babsy on February 11, 2008, 01:48:32 PM
but its still bugging me that the "line" under the text is overlapping if i have a picture in the small text.... the line "jumbs around"..... and it doesn´t look nice.... and the only solution i can figure out it so "enter" until it looks nice, but thats not a very smart solution... so  :?

i have tried to change it, but no luck, so if anyone has a solution, please post it here!! :?

Hi,
this is not a problem with the code snippet. You should specify stylesheet definitions for the appearance.

Regards,
spida.
Logged

vanbemmel

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #137 on: April 10, 2008, 08:54:13 AM »
Hello,

when i paste this code in my template i don't see any news.
What can i do wrong?


Quote from: fienieg on February 27, 2005, 06:50:48 PM
I made very rough code, that makes a listing of a specific group(id)
With the option of setting a "max results", and order them by date added. etc..

Just read the code, play with it. Refine it, restyle it.

Have fun..

Code: [Select]
<!-- NEWS READER -->
<?php
$group 
= 0; // Specify the Group(id) you want to read the news from

global $database;

$query = "SELECT post_id,title,group_id,link 
          FROM "
.TABLE_PREFIX."mod_news_posts
          WHERE group_id = 
$group
          ORDER BY posted_when DESC 
          LIMIT 0, 5;"
; // This limits the results to max 5, so if you want it to be 10, make it LIMIT 0, 10.
          // The first number defines the starting point, and the second the max/end of the results
$error = mysql_error();
if (!
$result = mysql_query($query)) {
    print 
"$error";
    exit;
    }

while(
$data = mysql_fetch_object($result)){
  
$title = $data->title;
  
$id = $data->post_id;
  
$link = $data->link; ?>

        <p>
         <a href="<?php echo WB_URL; ?><?php echo $link ?><?php echo PAGE_EXTENSION; ?>"><?php echo $title; ?></a>
         </p>
         <?php
    
}
?>

<!-- END NEWS READER -->
Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #138 on: April 10, 2008, 09:22:52 AM »
Hello,

habe you tried the original code snippet module AnyNews from the Addons repostiory?

Regards Christian
Logged

Offline Boudi

  • Posts: 1190
  • Gender: Male
  • //o_-\\
    • Yze Webdesign
Re: Code Snippet: Display news items, anywhere
« Reply #139 on: May 06, 2008, 11:52:30 AM »
Hi,

How can I remove the 'read more' function if there is no long text placed?

I checked the doc and the forum but could not find a solution.

Grtz
Knert
Logged
...:: Bake the Unbakable ::...

Offline ruebenwurzel

  • Betatester
  • **
  • Posts: 8544
  • Gender: Male
  • Keep on Rockin
    • Familie Gallas Online
Re: Code Snippet: Display news items, anywhere
« Reply #140 on: May 06, 2008, 12:42:47 PM »
Hello,

where did you wanna remove it?

In the news modul itself? look at the options of the news modul
or in the any news snippet? look at include.php in modules/anynews directory

Matthias
Logged

Offline Boudi

  • Posts: 1190
  • Gender: Male
  • //o_-\\
    • Yze Webdesign
Re: Code Snippet: Display news items, anywhere
« Reply #141 on: May 06, 2008, 02:21:56 PM »
Hi Matthias,

I use the anynews snippet for use on the homepage. I already checked the include.php but could not find where to change it.  :x

It's not that I completely want to remove the read more on the homepage, only when there's no long text written.

But I noticed just a few seconds away that you cannot click the text to go to the news function on the newspage itself. Only if there's a read more link.

So I adviced the client to use the short as the long text as well. Problem solved. Thnq for taking the time to respond.

Grtz
Knert  :-)
Logged
...:: Bake the Unbakable ::...

Offline Nowis

  • Posts: 14
Re: Code Snippet: Display news items, anywhere
« Reply #142 on: May 22, 2008, 12:43:47 PM »
Quote from: falkena on March 16, 2008, 10:26:17 PM
Hallo,
I have installed the new wb 2.7.
with the new news module i can put an start date an end dat to the news.
the problem is that anynews wil show it anyway.
Is there a way to fix this?


I can be done quite easily. You just have to edit modules/anynews/include.php

Code: [Select]
// query to obtain news items for the selected group
if ($group_id < 1) {
$query = "SELECT * FROM " .TABLE_PREFIX ."mod_news_posts WHERE active=1 ORDER BY position DESC LIMIT 0, $max_news_items;";
} else {
$query = "SELECT * FROM " .TABLE_PREFIX ."mod_news_posts WHERE group_id=$group_id AND active=1 ORDER BY position DESC LIMIT 0, $max_news_items;";
}

must be changed to

Code: [Select]
// query to obtain news items for the selected group
$t = time();
if ($group_id < 1) {
$query = "SELECT * FROM " .TABLE_PREFIX ."mod_news_posts WHERE active=1 AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t) ORDER BY position DESC LIMIT 0, $max_news_items;";
} else {
$query = "SELECT * FROM " .TABLE_PREFIX ."mod_news_posts WHERE group_id=$group_id AND active=1 AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t) ORDER BY position DESC LIMIT 0, $max_news_items;";
}
Logged

Offline shlack

  • Posts: 25
Re: Code Snippet: Display news items, anywhere
« Reply #143 on: May 24, 2008, 02:49:24 PM »
Quote from: knert on May 06, 2008, 11:52:30 AM
Hi,


How can I remove the 'read more' function if there is no long text placed?

I checked the doc and the forum but could not find a solution.

Grtz
Knert

According to a Readme file you should use the following function:

display_news_items($group_id, $max_news_items, $max_news_length, $display_mode,
$header_text, $readmore_text, $no_news_text, $strip_tags);

Example for customized call:

<?php display_news_items(0, 5, 50, 2, "The latest news", "show full news text", "uups, no news available", false); ?>

So just use empty string instead of "show full news text":

<?php display_news_items(0, 5, 50, 2, "The latest news", "", "uups, no news available", false); ?>

Logged

Offline Olli

  • Posts: 291
Re: Code Snippet: Display news items, anywhere
« Reply #144 on: May 28, 2008, 03:49:05 PM »
hello everybody,

i just read through the whole thread again but i don't know where to look for for a solution.

just to get a basic understanding what is needed: is the anynews module able to display <img>-tags properly that were inserted inside a news entry? right now all img tags and paths are destroyed when using anynews and i don't know why...

it does not matter if i turn stripping tags on or off... the img path is always broken/not there...

the path looks something like
Code: [Select]
http://local...%3c/p%3E%3Cp%3E%3Ca%20href=
can someone lend a helping hand? :-)

greetings
« Last Edit: May 29, 2008, 11:59:33 PM by Olli »
Logged

Offline marathoner

  • Posts: 495
Re: Code Snippet: Display news items, anywhere
« Reply #145 on: May 29, 2008, 03:06:41 AM »
The module is intended to be customized to meet your needs. By default, the 'content_short' field is displayed after it is stripped of tags (including IMG tags) but this can be changed so that they are not stripped. It sounds like you've done that. The script should then output whatever is stored in your database. Have you checked your database to see what is stored for your news postings?

It may be an encoding issue such as the database and your web page being encoded differently.

I did a test myself by creating a posting with an image in it and the module displays it fine once I comment out the strip_tags.

Here is the regular news posting and the same posting using Anynews module.
http://www.mohican100.org/pages/registeredpage/test-news.php
http://www.mohican100.org/pages/registeredpage/test-anynews-module.php
Logged

Offline Olli

  • Posts: 291
Re: Code Snippet: Display news items, anywhere
« Reply #146 on: May 30, 2008, 12:02:04 AM »
hello marathoner,

thanks for digging into this!
could you please tell me where exactly you commented out the stripping tags? i guess this is the point where i went wrong...

bye
Logged

Offline marathoner

  • Posts: 495
Re: Code Snippet: Display news items, anywhere
« Reply #147 on: May 30, 2008, 01:33:09 AM »
@Olli-

I have to apologize. I had commented out line 92 in the example that I listed above and that you looked at. It worked just fine; however, it wasn't until just now when I went back to see what the line number was did I realize that the display_news_items function already has this functionality built into it as the last (8th) parameter. You can simply call the display_news_items function as is with the 8th parameter set to FALSE (it's set to TRUE by default).

I've modified my example links above so that you can see the function called with default parameters and with the STRIP_TAGS parameter set to FALSE.

If this doesn't fix your problem, take a look at the data stored in your mod_news_posts table and see if the posting has your IMG tags in it.
« Last Edit: May 30, 2008, 01:43:04 AM by marathoner »
Logged

Offline Olli

  • Posts: 291
Re: Code Snippet: Display news items, anywhere
« Reply #148 on: May 30, 2008, 06:25:45 PM »
@marathoner: when displaying the news the regualar way (looking at the news page directly) everything is fine. all tags are there and nothing is broken.

but when using the anynews script all images are destroyed no matter if it set the strip-tag flag to true or false. i'm a bit stuck now i must admit. i can't get any progess into this.

using the old snipped from pc wacht does not help either. this is really confusing because it used to work in the past on another installation...

maybe this is a PHP5 concerned problem? hmm...

thanks for your help marathoner, will look at it all over again and will do a reinstall just to see if that helps...

greetings
Logged

doc

  • Guest
Re: Code Snippet: Display news items, anywhere
« Reply #149 on: May 30, 2008, 06:55:48 PM »
Hello,

just and idea, disable the output filter (if used) and check again.

Christian
Logged

  • Print
Pages: 1 ... 4 5 [6] 7 8 ... 21   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Code Snippet: Display news items, anywhere
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2