Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 07:09 pm EDT

Geeklog Forums

Login to Read More


Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
What do I need to do so that one has to log in to read the "read more", full story?

Sam
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
in system/lib-story.php change lines 211-224 from:
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>' );
        }


 
to this:
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>' );
            }
        }


 
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.
 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'
}
 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.
 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.


COM_article() is now in system/lib-story.php
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by Turias: COM_article() is now in system/lib-story.php

... and has been renamed STORY_renderArticle

bye, Dirk
 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.


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

Status: offline

k74

Forum User
Full Member
Registered: 09/19/04
Posts: 128
Location:Australia
Can someone help me
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 Very Happy
Live everyday as if it was your last!
 Quote

All times are EDT. The time is now 07:09 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