Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: 1 [2] 3 4   Go Down

Author Topic: News Bulletin - RSS feed generator, News Bulletin, News Manager...  (Read 70803 times)

0 Members and 1 Guest are viewing this topic.

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #20 on: November 14, 2007, 06:38:45 pm »

Maybe it something to do with your server, put this in a new file and then open the page. Then check to see if the table is created. Once the table is created you will be able to use the plugin.

Code: [Select]
$sql = 'CREATE TABLE `cpg1411_plugin_news` ('
        . ' `id` INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, '
        . ' `active` VARCHAR(10) NOT NULL, '
        . ' `rss` VARCHAR(10) NOT NULL, '
        . ' `date` DATE NOT NULL, '
        . ' `value` LONGTEXT NOT NULL, '
        . ' `name` VARCHAR(500) NOT NULL, '
        . ' `title` VARCHAR(500) NOT NULL'
        . ' )'
        . ' ENGINE = myisam'
        . ' COMMENT = \'Stores data for the News Bulletin plugin by just_some_guy.\';';

$result = cpg_db_query($sql);
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #21 on: November 14, 2007, 07:07:29 pm »

I entered what you gave me to create the table and I got an error:

#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '$sql = 'CREATE TABLE `cpg1411_plugin_news` ('
        . ' `id`
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #22 on: November 14, 2007, 07:23:58 pm »

Hmm, run this using a tool like phpmyadmin.
Code: [Select]
CREATE TABLE `cpg1411_plugin_news` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`active` VARCHAR( 10 ) NOT NULL ,
`rss` VARCHAR( 10 ) NOT NULL ,
`date` DATE NOT NULL ,
`value` LONGTEXT NOT NULL ,
`name` VARCHAR( 500 ) NOT NULL ,
`title` VARCHAR( 500 ) NOT NULL
) ENGINE = MYISAM COMMENT = '''Stores data for the News Bulletin plugin by just_some_guy.';
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #23 on: November 14, 2007, 07:28:17 pm »

Thats what I'm using and I entered what you gave me this time and I get:

MySQL said:

#1074 - Too big column length for column 'name' (max = 255). Use BLOB instead ???
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #24 on: November 14, 2007, 07:29:36 pm »

Ahh, must be a variation between the set up of your mysql and mine. Simple fix. run this code -

Code: [Select]
CREATE TABLE `cpg1411_plugin_news` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`active` VARCHAR( 10 ) NOT NULL ,
`rss` VARCHAR( 10 ) NOT NULL ,
`date` DATE NOT NULL ,
`value` LONGTEXT NOT NULL ,
`name` VARCHAR( 255 ) NOT NULL ,
`title` VARCHAR( 255 ) NOT NULL
) ENGINE = MYISAM COMMENT = '''Stores data for the News Bulletin plugin by just_some_guy.';
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #25 on: November 14, 2007, 07:41:13 pm »

Right the table has been created, I went back to installing the plugin (the 2nd attachment) it gives me the same error:

mySQL error: Too big column length for column 'name' (max = 255). Use BLOB instead ???
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #26 on: November 14, 2007, 07:50:55 pm »

Thats because its running that code again (the one that does not work for you). I have attached a modded version which skips the step of creating a table as you have done it manually. Then you can use the plugin, let me know if it works.
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #27 on: November 14, 2007, 08:16:12 pm »

Fantastic it worked. Thanks for the mod and thanks for all your help in making it work ;D
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #28 on: November 14, 2007, 08:22:27 pm »

No problem, good to hear you got it working in the end.
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #29 on: November 14, 2007, 10:32:44 pm »

EDIT: If you saw the last post I was wrong, when I place it before the categories it pushes the categories next to it when you click "news", everything is ok when you don't click "news" and if you place it at the bottom of the gallery, so basically if there is something after it, it messes up the gallery when clicked ;)

http://cdcoverhideout.com/gallery
« Last Edit: November 14, 2007, 10:38:40 pm by will »
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #30 on: November 14, 2007, 10:43:48 pm »

Weird, i never noticed that as i have my news block at the bottom of the page. I will look into that and get back to you. Sorry,
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #31 on: November 14, 2007, 10:50:05 pm »

Fixed, minor bug there, thanks for pointing that out.

To fix it.

Open /plugins/News_Bulletin/news.php

find

Code: [Select]
  <table align="left" width="100%" cellspacing="1" cellpadding="0" class="maintable" id="section"  border="0">
and replace with

Code: [Select]
<table id="section"  class="maintable" border="0">
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #32 on: November 14, 2007, 10:56:01 pm »

Thank you sorted, top man, 1 more thing please and this will be the last time lol.

Is there a way of making the news show by default and then members can click to make it disappear ;)
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #33 on: November 14, 2007, 11:13:02 pm »

Yes, delete this from news.php -

Code: [Select]
<script type="text/javascript">
        onload = hideall;
</script>

No problem,
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #34 on: November 14, 2007, 11:20:40 pm »

Thank you, that makes it show but what about making it disappear if you choose to ;)
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #35 on: November 14, 2007, 11:35:13 pm »

Sure,

Replace the contents of news.php with this -

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2007 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3
  as published by the Free Software Foundation.
  
  ********************************************
  Coppermine version: 1.4.13
  $Source$
  $Revision: 3837 $
  $Author: gaugau $
  $Date: 2007-08-16 18:56:06 +0200 (Do, 16 Aug 2007) $
**********************************************/
<<<EOT

<script type="text/javascript">
function expand2()
{
        var Nodes = document.getElementsByTagName("table")
        var max = Nodes.length
        for(var i = 0;i < max;i++) {
                var nodeObj = Nodes.item(i)
                var str = nodeObj.id
                if (str.match("section")) {
                        nodeObj.style.display = 'block';
                }
        }
}

</script>
<style>
text-align: left;
</style>

EOT;

if (!
defined('IN_COPPERMINE')) die('Not in Coppermine...');
echo <<< EOT


                <tr>
                        <td class="tableh2"  onclick="show_section('section')" >
                                <span style="cursor:pointer" ><img src="images/descending.gif" border="0" width="9" height="9" alt="" title="
{$lang_admin_php['click_expand']}" /> <b>News</b></span><a/>
                        </td>
                </tr>
                <tr>
                        <td>

                                <table id="section"  class="maintable" border="0">
EOT;

$sql ="SELECT * FROM cpg1411_plugin_news  WHERE active=1 ORDER BY date DESC";
$result cpg_db_query($sql);
while (
$row mysql_fetch_assoc($result)) {
echo 
'<tr>';
echo 
'<td align="left">';
echo 
"<strong><span style=\"text-decoration: underline\">";
echo  
$row["title"] , "<br />";
echo 
"</strong></span>";
echo 
'</td>';
echo 
'<td>';
echo  
$row["date"] , "<br />";
echo 
'</td>';
echo 
'<tr>';
echo 
'<td align="left">';
echo  
$row["value"] ,"<br />";
echo 
'</td>';
echo 
'</td>';
echo 
'<br/>';
echo  
'</tr>';



}
echo 
'</table>';






?>



just_some_guy,

EDIT - make sure you use this code ^^^^ will. I edited my post with a correction.
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #36 on: November 14, 2007, 11:42:25 pm »

not working, also found a issue in IE, when you hover over the main section all the text is highlighted, looks fine in FF ???
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #37 on: November 15, 2007, 08:01:12 am »

Will, what I was trying to say: you lack the experience to be the first user to install this plugin and use it. If it doesn't work for you out of the box, then it is not meant for you. I haven't looked into this plugin, but if you can't answer the basic question (what happens when the plugin tries to create the table in the first place? Does the mysql user have create permissions?), then you just don't qualify for this plugin. Look at this thread and how cluttered it already is, even though the plugin is very young.
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #38 on: November 15, 2007, 08:14:52 am »

Will, check my site - http://www.mysimtractor.com and scroll to the bottom of the page. The news block is exactly how you wanted, isn't it? - its expanded when the page loads and when clicking the text "News" it collapses and vise -versa. That was using the code i posted a few posts ago. I use IE and cannot replicate this error.

Sorry, GauGau for the mess this is making to the board, i assure the plugin does work as you can see on my site.
« Last Edit: November 15, 2007, 08:27:47 am by just_some_guy »
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: News Bulletin - RSS feed generator, News Bulletin, News Manager...
« Reply #39 on: November 15, 2007, 06:05:09 pm »

New version released; this address a minor bug fix found by will. I have also released a version which loads with the news block open and in this version i have changed some of the values used when creating the table so that it can be used on mysql servers that have maximum char count lower than 500.
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums
Pages: 1 [2] 3 4   Go Up
 

Page created in 0.02 seconds with 20 queries.