Welcome to Geeklog, Anonymous Friday, November 29 2024 @ 04:46 pm EST

Geeklog Forums

trying to you [staticpages:] in stories


Status: offline

Nygrah

Forum User
Newbie
Registered: 09/13/05
Posts: 7
I can not use these codes in story pages without getting errors. Can you please tell me what I'm doing wrong?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
It would help if you gave us the error message and an example of what you're trying to do ...

bye, Dirk
 Quote

Status: offline

Nygrah

Forum User
Newbie
Registered: 09/13/05
Posts: 7
caffeinated
In the Body text portion of my story input boxes i put <a href="http://www.geeklog.net/staticpages/index.php/fest_news"></a> fest_news being the name of one of my staticpages.

When I go to view the page I get the following error:

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 'WHERE sp_id = 'fest_news'' at line 1. SQL in question: SELECT sp_title FROM WHERE sp_id = 'fest_news'

I am not sure how to use those extra codes such as ([code], <a href="http://www.geeklog.net/article.php/"></a>, <a href="http://www.geeklog.net/calendar_event.php?eid="></a>, <a href="http://www.geeklog.net/staticpages/index.php/"></a&gtWink is there somewhere to get information on how they can work within the story format?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Hmm, I'm sure the forum did at one time let me post autotags within its CODE sections without interpreting them ...

The syntax for all autotags is (just imagine those being in square brackets [ ]): (tagname:id) where "tagname" is, for example, "staticpage" and "id" is simply an ID for the object to be displayed.

So to link to our static page about CVS, which has "cvs" as its ID, I would write (staticpage:cvs) and it would come out as Anonymous CVS Access

Or to link to faq entry #42, I would write (faq:42) and it would come out as Parse error in ...

And if I wanted a different text for the link, I simply add that after the ID: (staticpage:cvs How to use CVS) would become How to use CVS

HTH

bye, Dirk
 Quote

kcrothers

Anonymous
I'm having a similar problem. I would like for the contents to be displayed within a story. I've used the code (staticpage:dangerfield) where the parens are actually brackets and I get the following error:

Mon Sep 19 02:25:06 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 'WHERE sp_id = 'dangerfield'' at line 1. SQL in question: SELECT sp_title FROM WHERE sp_id = 'dangerfield'

It looks like the table name is missing from the select. How can I fix this?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by kcrothers: It looks like the table name is missing from the select. How can I fix this?

There's a typo in /path/to/geeklog/plugins/staticpages/functions.inc in function plugin_autotags_staticpages:
Text Formatted Code
    $linktext = stripslashes (DB_getItem ($_TABLES['staticpages'],
                              'sp_title', "sp_id = '$sp_id'"));
 

should read
Text Formatted Code
    $linktext = stripslashes (DB_getItem ($_TABLES['staticpage'],
                              'sp_title', "sp_id = '$sp_id'"));
 

i.e. the table name is 'staticpage', without the 's'.

bye, Dirk
 Quote

kcrothers

Anonymous
Got it! Thanks!

fyi - it's line 570 for me (version 1.3.11.sr1)
 Quote

All times are EST. The time is now 04:46 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