|
[1.1.3-1.2.0] News Categories
|
| Author |
Message |
Brian
Administrator
      
Posts: 122
Group: Administrators
Joined: Jan 2006
Status:
Offline
Reputation: 0
|
[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 |
|
 |
Scummi
Junior Member
 
Posts: 9
Group: Registered
Joined: Jan 2006
Status:
Offline
Reputation: 0
|
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 |
|
 |
Brian
Administrator
      
Posts: 122
Group: Administrators
Joined: Jan 2006
Status:
Offline
Reputation: 0
|
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 |
|
 |
Scummi
Junior Member
 
Posts: 9
Group: Registered
Joined: Jan 2006
Status:
Offline
Reputation: 0
|
RE: [1.1.3-1.2.0] News Categories
|
|
| 01-12-2006 01:50 PM |
|
 |
Brian
Administrator
      
Posts: 122
Group: Administrators
Joined: Jan 2006
Status:
Offline
Reputation: 0
|
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 |
|
 |
Brian "Nairb" Baker
Junior Member
 
Posts: 10
Group: Registered
Joined: Jan 2006
Status:
Offline
Reputation: 0
|
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:
<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)
|
|
| 01-13-2006 06:08 AM |
|
 |
Scummi
Junior Member
 
Posts: 9
Group: Registered
Joined: Jan 2006
Status:
Offline
Reputation: 0
|
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:
<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 |
|
 |
Scummi
Junior Member
 
Posts: 9
Group: Registered
Joined: Jan 2006
Status:
Offline
Reputation: 0
|
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
FIND:
------------------------------------
<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:
------------------------------------
<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:
------------------------------------
<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:
------------------------------------
<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 |
|
 |
Brian "Nairb" Baker
Junior Member
 
Posts: 10
Group: Registered
Joined: Jan 2006
Status:
Offline
Reputation: 0
|
RE: [1.1.3-1.2.0] News Categories
Ah yes!
That is only because I forgot to add this to the install file:
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)
|
|
| 01-13-2006 06:35 PM |
|
 |
TheBrev
Junior Member
 
Posts: 2
Group: Registered
Joined: May 2006
Status:
Offline
Reputation: 0
|
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 |
|
 |
|
|