Posted on: 05/11/05 05:01am
By: muadmz
when i publish a static page and than publish another one the next day, it end up going after the first static page which i created on the homepage only. How do i order this correctly so that everytime i create a new one on the homepage only, than it goes above the last one i published?
All my news is going all over the place now.
static pages
Posted on: 05/11/05 05:23am
By: geKow
look in plugins/staticpages/config.php:
// If you have more than one static page that is to be displayed in Geeklog's
// center area, you can specify how to sort them:
$_SP_CONF['sort_by'] = 'id'; // can be 'id', 'title', 'date'
So you can sort your static pages by date or by giving them ascending or descending IDs.
But why do you use static pages to publish your news?
geKow
static pages
Posted on: 05/11/05 09:14am
By: muadmz
thanks for the info.
i use it because the story does not let me use all html codes and for me to do that i would have to add all the html codes to the cofig.php and when i looked at it it looks pretty complicated:
$_CONF['admin_html'] = array (
'p' => array('class' => 1, 'id' => 1, 'align' => 1),
'div' => array('class' => 1, 'id' => 1),
'span' => array('class' => 1, 'id' => 1),
'table' => array('class' => 1, 'id' => 1, 'width' => 1, 'border' => 1,
'cellspacing' => 1, 'cellpadding' => 1),
as u can see i do not understand the array('class' => and all that part so Im pretty scared that I will end up messing it up if i try that.
regards.
static pages
Posted on: 05/11/05 09:59am
By: Robin
[QUOTE BY= muadmz]it looks pretty complicated[/QUOTE]
Fear no more This is actually pretty easy to update the allowable html tags.
'p' => array('class' => 1, 'id' => 1, 'align' => 1),
A bit of explanation:
'here you put an html tag' => array('here you put this tag attribute' =>1, 'here you put this tag another attribute' =>1),
That's not very complicated isn't it
static pages
Posted on: 05/11/05 10:32am
By: muadmz
thanks..
but im still confused about things like lets say the link html
<a href=""></a>
Do I do this:
'a href' => array('class' => 1, 'id' => 1, 'align' => 1),
how would i put things like that into there..? and im not too sure about the attributes part.. what should be for what.. what is the class, ir and align used for?. I usually use frontpage to create the page layout for the static pages so i dont usually play around with the codes to understand everything.
regards.
static pages
Posted on: 05/11/05 12:35pm
By: machinari
your link should already be in there like this:
'a' => array('href' => 1, 'title' => 1),
just add your other stuff like this:
'a' => array('href' => 1, 'title' => 1, 'class' => 1, 'id' => 1),
static pages
Posted on: 05/11/05 04:47pm
By: geKow
oh...and when you add stuff to that list, watch out to have a comma "," at the line ends and none at the last line.
geKow
static pages
Posted on: 05/11/05 08:52pm
By: samstone
If you are the only story admin you can remove that feature entirely for story admin. This feature also crippled some sites that uses utf-8 codes.
(Please let me vent a bit. Ever since this feature was added, I haven't seen a new Chinese language user, using utf-8, picked up Geeklog, simply because once they tried and and found it didn't work, they wouldn't explore more. It took me a heaven lot of learning to find out this feature was the problem. I love Geeklog and have been with it before this feature was added, so I didn't give up although I almost did. But, I understand it was for a good purpose, i.e. security. But it locks a quarter of world popluation out, and I don't even know what other languages are affected. When I complained a while back, I was told that it was KSES's fault, and asked me to contact KSES for the problem. When people don't use Geeklog, are we to blame KSES?)
For the sites I am the only story admin, I remove this feature by commenting out the following codes in /public_html/admin/story.php
// Clean up the text
if ($postmode == 'html') {
$introtext = COM_checkHTML (COM_checkWords ($introtext));
$bodytext = COM_checkHTML (COM_checkWords ($bodytext));
} else {
$introtext = htmlspecialchars (COM_checkWords ($introtext));
$bodytext = htmlspecialchars (COM_checkWords ($bodytext));
}
$title = addslashes(htmlspecialchars(strip_tags(COM_checkWords($title))));
The above removal does not remove the feature for other postings.
This feature is for security purpose, so you should remove it ONLY if you are confident that no one else that you can't trust would be posting stories as admin. You have been warned!
Sam
static pages
Posted on: 05/12/05 03:54pm
By: muadmz
thanks.. am i supposed to delete that whole part? i tried doing that.. but after that.. when i tried to test posting a new story with html , it gives me this error:
An SQL error has occured. Please see error.log for details.
You meant deleting the whole:
// Clean up the text
if ($postmode == 'html') {
$introtext = COM_checkHTML (COM_checkWords ($introtext));
$bodytext = COM_checkHTML (COM_checkWords ($bodytext));
} else {
$introtext = htmlspecialchars (COM_checkWords ($introtext));
$bodytext = htmlspecialchars (COM_checkWords ($bodytext));
}
$title = addslashes(htmlspecialchars(strip_tags(COM_checkWords($title))));
right? or did u mean something else?
static pages
Posted on: 05/12/05 04:38pm
By: samstone
I said to comment out. By commenting out I can uncomment it when I need it back. If you delete it you will have to reinsert the codes, or replace it with a backup. Sometimes it's good to know what the origninal is like so that we would remember what we have changed.
As for deleting the whole, it should be the whole thing shown in my previous posting, not that whole section because there is still one following line left from that section:
$comments = DB_count($_TABLES['comments'],'sid',$sid);
This is what I mean by commenting out:
// Clean up the text
/* Sam commented this section to disable html filtering
if ($postmode == 'html') {
$introtext = COM_checkHTML (COM_checkWords ($introtext));
$bodytext = COM_checkHTML (COM_checkWords ($bodytext));
} else {
$introtext = htmlspecialchars (COM_checkWords ($introtext));
$bodytext = htmlspecialchars (COM_checkWords ($bodytext));
}
$title = addslashes(htmlspecialchars(strip_tags(COM_checkWords($title))));
Sam */
This way, when I come back to this script to find out what I have done with it, I just search for the term 'Sam' and I will find the modifications I made. Othewise, by the next upgrade, you would have to figure out once again.
Commenting means making the program not to execute those codes. PHP would ignore the codes in BETWEEN the following signs:
/* ...... */
or behind the double slash //
static pages
Posted on: 05/13/05 02:56am
By: muadmz
thanks for the help. im going to test the html out again. hope it works. see u guys
static pages
Posted on: 05/13/05 03:05am
By: muadmz
sorry.. but i still get the following error when i comment it out.
An SQL error has occured. Please see error.log for details.
// Clean up the text
/* muad did this to disconnect html filtering
if ($postmode == 'html') {
$introtext = COM_checkHTML (COM_checkWords ($introtext));
$bodytext = COM_checkHTML (COM_checkWords ($bodytext));
} else {
$introtext = htmlspecialchars (COM_checkWords ($introtext));
$bodytext = htmlspecialchars (COM_checkWords ($bodytext));
}
$title = addslashes(htmlspecialchars(strip_tags(COM_checkWords($title))));
*/
$comments = DB_count($_TABLES['comments'],'sid',$sid);
thats how i did it.hhmm.. but dont know why it gives me that error.
static pages
Posted on: 05/13/05 10:26am
By: samstone
What does the error.log say?
Sam
static pages
Posted on: 05/13/05 11:54am
By: muadmz
<a href="http://news.bbc.co.uk/2/hi/south_asia/4532191.stm">read more</a>','',0,FROM_UNIXTIME(1115966929),'0','<a href="http://news.bbc.co.uk/2/hi/south_asia/4532191.stm">read more</a>',0,'-1','','1999-11-30 00:00:17','html','1',1,0,2,3,3,2,2,2,1)
Fri May 13 02:03:24 2005 - 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 'dissident' (bbc)','The country has rele. SQL in question: REPLACE INTO gl_stories (sid,uid,tid,title,introtext,bodytext,hits,date,comments,related,featured,commentcode,statuscode,expire,postmode,frontpage,draft_flag,numemails,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon,show_topic_icon) VALUES
i have no idea what the error means.
static pages
Posted on: 05/13/05 01:27pm
By: Dirk
[QUOTE BY= muadmz] i have no idea what the error means. [/QUOTE]
It means that it was a bad idea to remove the line that contains the addslashes() call.
bye, Dirk
static pages
Posted on: 05/13/05 01:30pm
By: samstone
OK, the problem is you are using quotes around the word 'dissident'.
It seems that you only need to do the following:
// Sam changed in the following line the word 'html' to 'plaintext'
// in conjuction with dissabliing the html filtering in the following lines
if ($postmode == 'plaintext') {
/* Sam commented out the following 3 lines to dissable html filtering
$introtext = COM_checkHTML (COM_checkWords ($introtext));
$bodytext = COM_checkHTML (COM_checkWords ($bodytext));
} else {
*/
$introtext = htmlspecialchars (COM_checkWords ($introtext));
$bodytext = htmlspecialchars (COM_checkWords ($bodytext));
}
$title = addslashes(htmlspecialchars(strip_tags(COM_checkWords($title))));
$comments = DB_count($_TABLES['comments'],'sid',$sid);
static pages
Posted on: 09/21/05 09:22am
By: muadmz
hi guys.. i wanted to ask u if the following codes i did are correct. This is to implement with the story html tags. Please tell me if theres something wrong because when I added these, there was an unexpected error in config.php
'html' => array(),
'body' => array('class' => 1, 'id' => 1, 'background' =>1, 'bgcolor =>1, 'text' =>1 'link' =>1, 'vlink' =>1),
'head' => array(),
'title' => array(),
'br' => array('class' => 1, 'id' => 1, 'clear' =>1),
'font' => array('class' => 1, 'id' => 1, 'face' =>1, 'size' =>1 'color' =>1),
'hr' => array('class' => 1, 'id' => 1, 'size' =>1, 'width' =>1),
'ul' => array('class' => 1, 'id' => 1, 'type' =>1),
'a' => array('class' => 1, 'id' => 1, 'href' =>1, 'target' =>1),
'img' => array('src' =>1, 'align' =>1, 'width' =>1, 'height' =>1 'alt' =>1),
'table' => array('class' => 1, 'id' => 1, 'border' =>1, 'width' =>1 'cellspacing' =>1, 'cellpadding' =>1, 'bgcolor' =>1,
'background' =>1),
'tr' => array('class' => 1, 'id' => 1, 'align' =>1, 'valign' =>1, 'bgcolor' =>1),
'td' => array('class' => 1, 'id' => 1, 'align' =>1, 'valign' =>1, 'width' =>1, 'nowrap' =>1, 'colspan' =>1, 'rowspan'
=>1, 'bgcolor' =>1),
'th' => array('class' => 1, 'id' => 1, 'align' =>1, 'valign' =>1, 'width' =>1, 'nowrap' =>1, 'colspan' =>1, 'rowspan'
=>1, 'bgcolor' =>1),
'caption' => array('class' => 1, 'id' => 1, 'align' =>1, 'valign' =>1),
'style' => array('class' => 1, 'id' => 1, 'type' =>1),
'link' => array('class' => 1, 'id' => 1, 'rel' =>1, 'type' =>1, 'href' => 1),
maybe im not supposed to put the class and id attributes to all of them? if so which ones? appreciate any help on this thanks
Oh and dont mind the spacing because when I copied pasted it here, it shows up some spacing between the lines.
static pages
Posted on: 09/21/05 02:20pm
By: Dirk
[QUOTE BY= muadmz] i wanted to ask u if the following codes i did are correct.[/QUOTE]
What are you trying to do (as it seems this question doesn't have anything to do with the rest of this thread)?
If it's still about static pages: You can use all HTML in static pages anyway (unless you switched that off in the plugin's config.php), as it says right there in the static pages editor ...
bye, Dirk
static pages
Posted on: 09/22/05 04:12pm
By: Robin
[QUOTE BY= muadmz] hi guys.. i wanted to ask u if the following codes i did are correct. This is to implement with the story html tags. Please tell me if theres something wrong because when I added these, there was an unexpected error in config.php[/QUOTE]
OK first of all if you get an error message there is usually the line number which causes troubles.
And secondly in the last line you should remove the end comma.
HTH