Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 08:24 pm EST
Geeklog Forums
Login to Read More
Status: Banned
machinari
Forum User
Full Member
Registered: 03/22/04
Posts: 1512
in system/lib-story.php change lines 211-224 from:
{
$article->set_var( 'lang_readmore', $LANG01[2] );
$article->set_var( 'lang_readmore_words', $LANG01[62] );
$numwords = sizeof( explode( ' ', $A['bodytext'] ));
$article->set_var( 'readmore_words', $numwords );
$article->set_var( 'readmore_link', '<a href="' . $articleUrl . '">'
. $LANG01[2] . '</a> (' . $numwords . ' ' . $LANG01[62]
. ') ' );
$article->set_var( 'start_readmore_anchortag', '<a href="'
. $articleUrl . '">' );
$article->set_var( 'end_readmore_anchortag', '</a>' );
}
to this:
{
if( $A['uid'] > 1 )
{
$article->set_var( 'lang_readmore', $LANG01[2] );
$article->set_var( 'lang_readmore_words', $LANG01[62] );
$numwords = sizeof( explode( ' ', $A['bodytext'] ));
$article->set_var( 'readmore_words', $numwords );
$article->set_var( 'readmore_link', '<a href="' . $articleUrl . '">'
. $LANG01[2] . '</a> (' . $numwords . ' ' . $LANG01[62]
. ') ' );
$article->set_var( 'start_readmore_anchortag', '<a href="'
. $articleUrl . '">' );
$article->set_var( 'end_readmore_anchortag', '</a>' );
}
}
you will have to do a similar thing for the comments link if comments exist. This is just one option--prolly the simplest.
remember, this just hides links and doesn't take care of displaying the article if someone types in the link.
Text Formatted Code
if( !empty( $A['bodytext'] )){
$article->set_var( 'lang_readmore', $LANG01[2] );
$article->set_var( 'lang_readmore_words', $LANG01[62] );
$numwords = sizeof( explode( ' ', $A['bodytext'] ));
$article->set_var( 'readmore_words', $numwords );
$article->set_var( 'readmore_link', '<a href="' . $articleUrl . '">'
. $LANG01[2] . '</a> (' . $numwords . ' ' . $LANG01[62]
. ') ' );
$article->set_var( 'start_readmore_anchortag', '<a href="'
. $articleUrl . '">' );
$article->set_var( 'end_readmore_anchortag', '</a>' );
}
Text Formatted Code
if( !empty( $A['bodytext'] )){
if( $A['uid'] > 1 )
{
$article->set_var( 'lang_readmore', $LANG01[2] );
$article->set_var( 'lang_readmore_words', $LANG01[62] );
$numwords = sizeof( explode( ' ', $A['bodytext'] ));
$article->set_var( 'readmore_words', $numwords );
$article->set_var( 'readmore_link', '<a href="' . $articleUrl . '">'
. $LANG01[2] . '</a> (' . $numwords . ' ' . $LANG01[62]
. ') ' );
$article->set_var( 'start_readmore_anchortag', '<a href="'
. $articleUrl . '">' );
$article->set_var( 'end_readmore_anchortag', '</a>' );
}
}
remember, this just hides links and doesn't take care of displaying the article if someone types in the link.
12
14
Quote
Status: Banned
machinari
Forum User
Full Member
Registered: 03/22/04
Posts: 1512
or maybe you could do the
if (logged in)
{
line211//adds bodytext
}
else
{
'you cant see this'
}
if (logged in)
{
line211//adds bodytext
}
else
{
'you cant see this'
}
15
17
Quote
Status: offline
LWC
Forum User
Full Member
Registered: 02/19/04
Posts: 818
What about TheRaftGuy's answer to question 4 here?
Does it solve the "bypass by using direct URL" problem?
Then again, I can't seem to find any COM_article anywhere ("add to function COM_article")...maybe it's an outdated function. I wonder what replaces it.
Does it solve the "bypass by using direct URL" problem?
Then again, I can't seem to find any COM_article anywhere ("add to function COM_article")...maybe it's an outdated function. I wonder what replaces it.
12
17
Quote
Status: offline
Turias
Forum User
Full Member
Registered: 10/20/03
Posts: 807
Quote by LWC: What about TheRaftGuy's answer to question 4 here?
Does it solve the "bypass by using direct URL" problem?
Then again, I can't seem to find any COM_article anywhere ("add to function COM_article")...maybe it's an outdated function. I wonder what replaces it.
Does it solve the "bypass by using direct URL" problem?
Then again, I can't seem to find any COM_article anywhere ("add to function COM_article")...maybe it's an outdated function. I wonder what replaces it.
COM_article() is now in system/lib-story.php
10
18
Quote
Mark
Anonymous
Quote by LWC: What about TheRaftGuy's answer to question 4 here?
Does it solve the "bypass by using direct URL" problem?
Then again, I can't seem to find any COM_article anywhere ("add to function COM_article")...maybe it's an outdated function. I wonder what replaces it.
Does it solve the "bypass by using direct URL" problem?
Then again, I can't seem to find any COM_article anywhere ("add to function COM_article")...maybe it's an outdated function. I wonder what replaces it.
Did you get that old hack to work? I originally used it just fine. Then with various changes to GL it didn't work anymore.
I tried moving things around but still no good. It works to an extent but anonymous can print which defeats the whole purpose. Also for some reason the template file that's called doesn't work so now I have it call an external page - locked.php.
Any other ideas on doing this and making it work fully with GL security? What I'd like to do is something like:
Everyone sees the intro text.
If they aren't registered they see a "locked" type page that is customizable by me. Each article should be configurable - don't want all open or all locked.
Thanks.
13
12
Quote
Status: offline
k74
Forum User
Full Member
Registered: 09/19/04
Posts: 128
Location:Australia
I tried TheRaftGuy hack to lock articles and get the following message:
Parse error: parse error, expecting `']'' in /.../......./system/lib-story.php on line 67
Fatal error: Call to undefined function: story_renderarticle() in /....../......./......./my_url/html/index.php on line 198
Can anyone give me any suggestions on how to get this hack working with 1.3.11? I would really like to achieve this function with my site.
I have also tried Machinari hack : Login to read more but this made no difference, which I can't understand why as it seems simple enough to work but it doesn't.
Marks idea of integrating this within Geeklog's security sounds good for future upgrades/versions. It would be good to have an admin option at least of locking each story individually from users who aren't logged in.
Regards
Kev
Live everyday as if it was your last!
16
35
Quote
All times are EST. The time is now 08:24 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