|
Page 1 of 2
|
TheSteffen
Joined: August 2006
Posts: 1625
Location: Magdeburg
|
Only First Post Possible To Read For Guests
Hey,
I don´t know if this is easy possible...
I would like to have a switch, that in one special forum guest can only read the first post.
Maybe with sponsor text above.
Now guest can read the complet topic with all replys.
Does anyone know how to change this or maybe there would be a chnace to insert this in next version of IP
Maybe other users also would like it.
Thanks
____________ TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
|
#1 Sat 09 Apr, 2011 14:56 |
|
Sponsors
|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
spydie
Joined: December 2008
Posts: 1796
Location: In the Boxes
|
Re: Only First Post Possible To Read For Guests
should be possible
i think, i´ve seen something in posting php, or was it viewtopic.php, that had to do with the first post check and post sorting,
adding some code there like :
IF is not first post and Forum ID = Forum ID
display : false;
ElseIf blahblah
This is no actual code,
It´s just an idea
got to play with this idea a bit further, to actual put some usable code here
____________ Out of Order
|
#2 Sat 09 Apr, 2011 15:42 |
|
Informpro
Joined: October 2008
Posts: 1110
Location:
|
Re: Only First Post Possible To Read For Guests
This should'nt be too complicated.
|
#3 Sat 09 Apr, 2011 16:33 |
|
TheSteffen
Joined: August 2006
Posts: 1625
Location: Magdeburg
|
Re: Only First Post Possible To Read For Guests
Thanks spydie and Informpro for your quick answer.
If you have some time you can play with it
Thanks a lot
Hardcoded would be enough for me
____________ TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
|
#4 Sat 09 Apr, 2011 16:38 |
|
Informpro
Joined: October 2008
Posts: 1110
Location:
|
Re: Only First Post Possible To Read For Guests
(see above)
Last edited by Informpro on Sun 10 Apr, 2011 00:30; edited 3 times in total |
#5 Sat 09 Apr, 2011 18:04 |
|
TheSteffen
Joined: August 2006
Posts: 1625
Location: Magdeburg
|
Re: Only First Post Possible To Read For Guests
WOW Informpro, thanks a lot, I will give it a try later.
One Question about that:
- if (!$user->data['session_logged_in'])
- {
- $sql .= " LIMIT 1";
- }
Doesn´t that mean, when user is logged_in then set Limit to 1
Shoudn´t it be, if User logged_out (for guests) then set Limit to 1
Can you please explain to me, that I learn a bit more about php
Thanks
____________ TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
|
#6 Sat 09 Apr, 2011 18:43 |
|
Informpro
Joined: October 2008
Posts: 1110
Location:
|
Re: Only First Post Possible To Read For Guests
The "!" means "not".
So "if not logged_id then limit 1".
Tell me if it works !
|
#7 Sat 09 Apr, 2011 19:45 |
|
TheSteffen
Joined: August 2006
Posts: 1625
Location: Magdeburg
|
Re: Only First Post Possible To Read For Guests
Hey Informpro,
I tried both versions, but it doesn´t seems to work.
Tested it local with xampp
Do you have something elso for me to test?!?
____________ TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
|
#8 Sat 09 Apr, 2011 22:34 |
|
Informpro
Joined: October 2008
Posts: 1110
Location:
|
Re: Only First Post Possible To Read For Guests
The real solution :
For every forum
search -
LIMIT " . $start . ", " . $config['posts_per_page'];
Replace with -
LIMIT " . ($user->data['session_logged_in'] ? $start . ", " . $config['posts_per_page'] : 1);
For particular forums only
search -
LIMIT " . $start . ", " . $config['posts_per_page'];
Replace with -
LIMIT " . (!$user->data['session_logged_in'] && ($forum_id == 5 || $forum_id == 6) ? 1 : $start . ", " . $config['posts_per_page']);
Last edited by Informpro on Sun 10 Apr, 2011 00:31; edited 2 times in total |
#9 Sat 09 Apr, 2011 23:19 |
|
TheSteffen
Joined: August 2006
Posts: 1625
Location: Magdeburg
|
Re: Only First Post Possible To Read For Guests
Thanks Informpro,
this is working
- LIMIT " . (!$user->data['session_logged_in'] and ($forum_id == 1) ? 1 : $start . ", " . $config['posts_per_page']);
But now I get for all topics only the first post.
Not only for $forum_id == 1
Can that be fixed? Thanks
____________ TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
|
#10 Sat 09 Apr, 2011 23:48 |
|
Informpro
Joined: October 2008
Posts: 1110
Location:
|
Re: Only First Post Possible To Read For Guests
Wow - I'm pretty tired. Just replace "and" with "&&" (and or by ||, if you have). Sorry.
|
#11 Sun 10 Apr, 2011 00:18 |
|
TheSteffen
Joined: August 2006
Posts: 1625
Location: Magdeburg
|
Re: Only First Post Possible To Read For Guests
Thanks a lot... it is working fine
Here is the code I used
OPEN viewtopic.php
FIND
LIMIT " . $start . ", " . $config['posts_per_page'];
REPLACE WITH
LIMIT " . (!$user->data['session_logged_in'] && ($forum_id == 1) ? 1 : $start . ", " . $config['posts_per_page']);
____________ TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
|
#12 Sun 10 Apr, 2011 00:28 |
|
Informpro
Joined: October 2008
Posts: 1110
Location:
|
Re: [SOLVED] Only First Post Possible To Read For Guests
Oh, yes, it should be enough. Glad to help !
|
#13 Sun 10 Apr, 2011 00:30 |
|
TheSteffen
Joined: August 2006
Posts: 1625
Location: Magdeburg
|
Re: [SOLVED] Only First Post Possible To Read For Guests
Sorry, but I have to ask again...
The chages I made works, but not only for guests.
Even admins can now only see the first post in each topic.
Can that be solved?
Thanks
____________ TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
|
#14 Tue 12 Apr, 2011 20:31 |
|
Informpro
Joined: October 2008
Posts: 1110
Location:
|
Re: [SOLVED] Only First Post Possible To Read For Guests
I just tried it in my dev version and it works. Try to reverse && parts but ...
|
#15 Tue 12 Apr, 2011 21:43 |
|
|
Page 1 of 2
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|