Post Reply  Post Thread 
Pages (2): « First [1] 2 Next > Last »
[1.1.3-1.2.0] News Categories
Author Message
Brian
Administrator
*******


Posts: 122
Group: Administrators
Joined: Jan 2006
Status: Offline
Reputation: 0
Post: #1
[1.1.3-1.2.0] News Categories

Download: http://www.utopiasoftware.net/newspro/ha...gories.zip

Author: Brian Baker, not me

NOTE: This only theoretically works in versions above 1.1.3. It has not been tested with anything other than 1.1.3 and 1.1.4.

// Thread cheaply imported from the old iB forum


Brian Earley
Utopia Software
utopiasupport@gmail.com
http://www.utopiasoftware.net
Software: Utopia News Pro

This post was last modified: 01-14-2006 06:50 AM by Brian.

01-07-2006 04:03 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Scummi
Junior Member
**


Posts: 9
Group: Registered
Joined: Jan 2006
Status: Offline
Reputation: 0
Post: #2
RE: [1.1.3-1.2.0] News Categories

I can't seem to get this thing working
I'm using version 1.2.0
and I did everything as described, but the image doesnt't show up
just look for yourself
http://www.scummi.nl/nije/nieuws.php
in de white square, on the left of every table, that's where the categorie-image should be

can someone please help me out??

This post was last modified: 01-13-2006 11:39 AM by Scummi.

01-12-2006 01:33 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Brian
Administrator
*******


Posts: 122
Group: Administrators
Joined: Jan 2006
Status: Offline
Reputation: 0
Post: #3
RE: [1.1.3-1.2.0] News Categories

Hm. What's the URL to the newspro directory (so I can see news.php directly)?


Brian Earley
Utopia Software
utopiasupport@gmail.com
http://www.utopiasoftware.net
Software: Utopia News Pro
01-12-2006 01:38 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Scummi
Junior Member
**


Posts: 9
Group: Registered
Joined: Jan 2006
Status: Offline
Reputation: 0
Post: #4
RE: [1.1.3-1.2.0] News Categories
01-12-2006 01:50 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Brian
Administrator
*******


Posts: 122
Group: Administrators
Joined: Jan 2006
Status: Offline
Reputation: 0
Post: #5
RE: [1.1.3-1.2.0] News Categories

I'll see if I can ask Brian Baker (the author) what he thinks.


Brian Earley
Utopia Software
utopiasupport@gmail.com
http://www.utopiasoftware.net
Software: Utopia News Pro
01-13-2006 05:06 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Brian "Nairb" Baker
Junior Member
**


Posts: 10
Group: Registered
Joined: Jan 2006
Status: Offline
Reputation: 0
Post: #6
RE: [1.1.3-1.2.0] News Categories

I could be wrong. But {$cat[image]} is only supposed to return the address to the image. So you're going to need to do:

Code:
<img src="{$cat[image]}" />


Inside the news template... I believe... But if {$cat[image]} isn't returning ANYTHING... check to make sure all of the mysql data is correct...



EDIT!!!!

Try using {$cat[imageloc]} I think I may have overlooked that in my debugging... crap


Brian "Nairb" Baker
Vice-President of UtopiaSoft
nairb@utopiasoftware.net
http://www.utopiasoftware.net
My Software: Utopia Board (In Progress)

This post was last modified: 01-13-2006 06:09 AM by Brian "Nairb" Baker.

01-13-2006 06:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Scummi
Junior Member
**


Posts: 9
Group: Registered
Joined: Jan 2006
Status: Offline
Reputation: 0
Post: #7
RE: [1.1.3-1.2.0] News Categories

Thank you Brian #2
your explanation didn't make it work completely
but with your help I managed to get it working

I had to add:

Code:
<img src="{$unpurl}{$cat[imageloc]}">


or I just could link my image in te categories-admin to the main map where the image is in

01-13-2006 11:39 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Scummi
Junior Member
**


Posts: 9
Group: Registered
Joined: Jan 2006
Status: Offline
Reputation: 0
Post: #8
RE: [1.1.3-1.2.0] News Categories

darn, it still didn't work

but, I found the problem and the solution

in both editnews.php and postnews.php you say

Quote:
FIND:
------------------------------------

Code:
<tr>
    <td width="15%"><strong>Subject:</strong></td>
    <td width="85%"><input type="text" size="35" tabindex="1" maxlength="100" name="subject" /></td>
</tr>


------------------------------------
REPLACE WITH:
------------------------------------

Code:
<tr>
    <td width="15%"><strong>Subject:</strong></td>
    <td width="85%"><input type="text" size="35" tabindex="1" maxlength="100" name="subject" /></td>
</tr>

<!-- Categories Hack -->
<tr>
    <td width="15%"><strong>Category:</strong></td>
    <td width="85%"><select name="[b]category[/b]">';
    $getCat = $DB->query("SELECT * FROM `unp_categories`");
    while($cat = $DB->fetch_array($getCat))
    {
        echo '<option value="'.$cat['id'].'">'.$cat['name'].'</option>';
    }
    echo '</select></td>
</tr>
<!-- Categories Hack -->

------------------------------------


the problem is that the name of the variable to set the category is wrong
you say: name="categorie"
but is has to be: name="catid"


so what you have to do in both editnews.php and postnews.php is:

FIND:
------------------------------------

Code:
<tr>
    <td width="15%"><strong>Subject:</strong></td>
    <td width="85%"><input type="text" size="35" tabindex="1" maxlength="100" name="subject" /></td>
</tr>


------------------------------------
REPLACE WITH:
------------------------------------

Code:
<tr>
    <td width="15%"><strong>Subject:</strong></td>
    <td width="85%"><input type="text" size="35" tabindex="1" maxlength="100" name="subject" /></td>
</tr>

<!-- Categories Hack -->
<tr>
    <td width="15%"><strong>Category:</strong></td>
    <td width="85%"><select name="[b]catid[/b]">';
    $getCat = $DB->query("SELECT * FROM `unp_categories`");
    while($cat = $DB->fetch_array($getCat))
    {
        echo '<option value="'.$cat['id'].'">'.$cat['name'].'</option>';
    }
    echo '</select></td>
</tr>
<!-- Categories Hack -->


------------------------------------

01-13-2006 01:31 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Brian "Nairb" Baker
Junior Member
**


Posts: 10
Group: Registered
Joined: Jan 2006
Status: Offline
Reputation: 0
Post: #9
RE: [1.1.3-1.2.0] News Categories

Ah yes!

That is only because I forgot to add this to the install file:

Code:
IN POSTNEWS.PHP FIND:
------------------------------------
        $submitnews = $DB->query("INSERT INTO `unp_news` (`date`, `subject`, `news`, `posterid`,`poster`,`catid`) VALUES ('$posttime','$subject','$news','$newsposterid','$newsposter','$catid')");

------------------------------------
ABOVE PLACE:
------------------------------------

        // Category Hack
            $catid = $_POST['category'];
        // Category Hack

------------------------------------


That's why when you changed it to "catid" it already used it as a POST variable... so, either way works.


Brian "Nairb" Baker
Vice-President of UtopiaSoft
nairb@utopiasoftware.net
http://www.utopiasoftware.net
My Software: Utopia Board (In Progress)

This post was last modified: 01-14-2006 05:55 AM by Brian "Nairb" Baker.

01-13-2006 06:35 PM
Visit this user's website Find all posts by this user Quote this message in a reply
TheBrev
Junior Member
**


Posts: 2
Group: Registered
Joined: May 2006
Status: Offline
Reputation: 0
Post: #10
RE: [1.1.3-1.2.0] News Categories

Hi I was testing out your script and I was wondering if there is a way we can list the news by categories? And if we can alter this hack to add other misc stuff i.e.; mood, what music currently listening or a blank to add your own things?

05-19-2006 11:19 AM
Find all posts by this user Quote this message in a reply
Pages (2): « First [1] 2 Next > Last »
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: