Private content - require users to be logged in to view / post | Support | Forum

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?
sp_Feed sp_TopicIcon
Private content - require users to be logged in to view / post
Andrewski
Member
Members
Forum Posts: 4
Member Since:
August 9, 2017
sp_UserOfflineSmall Offline
1
August 10, 2017 - 3:58 pm
sp_Permalink sp_Print

Hi, I am trying to create a private Kliqqi site and want to restrict registrations and require users to be logged in to view and post. Is this currently possible?

Kshitij Kumar
Moderator
Members

Moderators
Forum Posts: 113
Member Since:
April 20, 2016
sp_UserOfflineSmall Offline
2
August 11, 2017 - 12:49 am
sp_Permalink sp_Print

Since this question is asked a lot, I'm adding a simple solution.

1) Create a file redirect.php in root folder

2) Add this code in it: https://pastebin.com/WeS9FQGz

3) Now add: include('redirect.php'); in all files in which you want users to register first.
* Note: Add this line after all includes e.g. in story.php, add after include_once(mnminclude.'user.php');

Please let me know if this solved your issue.

Andrewski
Member
Members
Forum Posts: 4
Member Since:
August 9, 2017
sp_UserOfflineSmall Offline
3
August 13, 2017 - 10:38 pm
sp_Permalink sp_Print

Thanks for the help! So, I tweaked it a bit and changed redirect.php to send to login.php instead of register.php. Then, I deleted register.php so only I can create new users. I added the include code to

index.php
advancedsearch.php
cloud.php
new.php
rss.php
rssfeeds.php
rsssearch.php
search.php
story.php
storyrss.php
topusers.php

Now I'm wondering if it is possible to hide categories.tpl from the login page, so unlogged users can't see the categories.

Kshitij Kumar
Moderator
Members

Moderators
Forum Posts: 113
Member Since:
April 20, 2016
sp_UserOfflineSmall Offline
4
August 14, 2017 - 3:47 am
sp_Permalink sp_Print

I'll send you the codes in few hours. Keep checking forum.

Andrewski
Member
Members
Forum Posts: 4
Member Since:
August 9, 2017
sp_UserOfflineSmall Offline
5
August 16, 2017 - 10:44 pm
sp_Permalink sp_Print

Great, I appreciate it.

Kshitij Kumar
Moderator
Members

Moderators
Forum Posts: 113
Member Since:
April 20, 2016
sp_UserOfflineSmall Offline
6
August 17, 2017 - 8:57 am
sp_Permalink sp_Print

Please add this new redirect file code: https://pastebin.com/TNnQyTSE

In bootstrap/categories.tpl, add before top div:

{if $isLoggedIn eq 1}

and after last closing div, add:

{/if}

Please let me know if it works. I haven't checked it myself.

Andrewski
Member
Members
Forum Posts: 4
Member Since:
August 9, 2017
sp_UserOfflineSmall Offline
7
August 23, 2017 - 8:07 pm
sp_Permalink sp_Print

Seems to be working great, thanks

Kshitij Kumar
Moderator
Members

Moderators
Forum Posts: 113
Member Since:
April 20, 2016
sp_UserOfflineSmall Offline
8
August 23, 2017 - 11:34 pm
sp_Permalink sp_Print

Great 👍

Forum Timezone: America/New_York

Most Users Ever Online: 33

Currently Online:
4 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Adam Burton: 103

DrCrash: 74

cyrus: 60

lipsmega: 50

OxyThemes: 36

Newest Members:

bababa

dasdfasdfasdf

Gambit Communications

saam

Columnist Hub

Praveen Gulia

zzk

missfamily

emunyryx

mark

Forum Stats:

Groups: 1

Forums: 8

Topics: 352

Posts: 1772

 

Member Stats:

Guest Posters: 2

Members: 1244

Moderators: 2

Admins: 1

Administrators: ChuckRoast

Moderators: Kshitij Kumar, Mthobisi