Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 07:43 pm EST

Geeklog Forums

static pages


Status: offline

muadmz

Forum User
Chatty
Registered: 03/05/05
Posts: 51
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. Smile
 Quote

Status: offline

geKow

Forum User
Full Member
Registered: 01/12/03
Posts: 445
look in plugins/staticpages/config.php:
Text Formatted Code
// 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
 Quote

Status: offline

muadmz

Forum User
Chatty
Registered: 03/05/05
Posts: 51
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:

Text Formatted Code
$_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. Smile
 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
Quote by muadmz:it looks pretty complicated

Fear no more Wink This is actually pretty easy to update the allowable html tags.
Text Formatted Code
'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 Wink
Geeklog Polish Support Team
 Quote

Status: offline

muadmz

Forum User
Chatty
Registered: 03/05/05
Posts: 51
thanks.. Smile

but im still confused about things like lets say the link html
Text Formatted Code
 <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. Smile

regards. Smile
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
your link should already be in there like this:
Text Formatted Code
    'a'    => array('href' => 1, 'title' => 1),

 

just add your other stuff like this:
Text Formatted Code

    'a'    => array('href' => 1, 'title' => 1, 'class' => 1, 'id' => 1),

 
 Quote

Status: offline

geKow

Forum User
Full Member
Registered: 01/12/03
Posts: 445
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
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
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

Text Formatted Code
        // 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
 Quote

Status: offline

muadmz

Forum User
Chatty
Registered: 03/05/05
Posts: 51
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:

Text Formatted Code
        // 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?

Smile
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
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:
Text Formatted Code
        $comments = DB_count($_TABLES['comments'],'sid',$sid);


 


This is what I mean by commenting out:

Text Formatted Code
        // 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:
Text Formatted Code
/* ...... */
 


or behind the double slash //
 Quote

Status: offline

muadmz

Forum User
Chatty
Registered: 03/05/05
Posts: 51
thanks for the help. im going to test the html out again. Smile hope it works. Very Happy see u guys
 Quote

Status: offline

muadmz

Forum User
Chatty
Registered: 03/05/05
Posts: 51
sorry.. but i still get the following error when i comment it out.

An SQL error has occured. Please see error.log for details.

Text Formatted Code

        // 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.
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
What does the error.log say?

Sam
 Quote

Status: offline

muadmz

Forum User
Chatty
Registered: 03/05/05
Posts: 51
Text Formatted Code
<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. Smile
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by muadmz: i have no idea what the error means. Smile

It means that it was a bad idea to remove the line that contains the addslashes() call.

bye, Dirk
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
OK, the problem is you are using quotes around the word 'dissident'.

It seems that you only need to do the following:
Text Formatted Code
// 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);


 
 Quote

Status: offline

muadmz

Forum User
Chatty
Registered: 03/05/05
Posts: 51
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 Wink thanks

Oh and dont mind the spacing because when I copied pasted it here, it shows up some spacing between the lines.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by muadmz: i wanted to ask u if the following codes i did are correct.

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
 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
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


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 Smile
Geeklog Polish Support Team
 Quote

All times are EST. The time is now 07:43 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content