php forum
php mysql forum
php mysql smarty
 
Page 1 of 3 1 2 3 >
Topic Options
#255730 - 08/04/03 04:07 AM Unregistered users only see first post and X amount of letters/chrs
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
Here is what I currently have... <br />http://www.everythingcelica.com/installs/index.shtml <br /> <br />What I would like to see is a modified announcement/article template that will allow only the main post and X amount of characters to be displayed for anyone who is not a registered account.... <br /> <br />Something that will give people a "tease" of what they can get after they become a registered member. <br /> <br />I am sure this is just a modified piece of code that needs to be added to the shotflat.php (or custom article.php) file... but my php skills are lacking in this area. <br /> <br />I think this would be an awesome hack for sites wanting more member registrations. I personaly am sick of seeing, "currently there are 200 members and 450 unregistered users online" <br /> <br />Any input will be more than helpfull and extremely apreciated []http://www.everythingcelica.com/ubbthreads/images/graemlins/thumbsup.gif[/] thank you!

Top
#255731 - 08/06/03 03:15 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
i guess this isnt such a popular idea... ?<br /><br />i need to touch up my php skills and do it for myself if no one will take on this task for the group <img src="/forum/images/graemlins/crazy.gif" alt="" />

Top
#255732 - 08/06/03 03:31 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
This probably wouldn't bee too difficult.<br /><br />I'd tackle it, but I just have a full plate right now to tackle stuff for here. <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />But if I find myself bored. .... <img src="/forum/images/graemlins/wink.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#255733 - 08/06/03 03:36 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
ID242,<br /><br /> You have posted in the right place. I can assure you people do read these things. I can tell you that given time someone might look at this and write it up.<br /><br /> However if it is an urgency or something you might want to see in a week or two then you have two things you can do.<br /><br /> 1. Write it yourself which you have already suggested you might do. <br /><br /> 2. Or hire someone in our developer's for hire forum to <br /> write it for you.<br /><br /> If you choose to write it yourself if some hacks that might give you idea's on how to process will be JoshPet's Teaser Forum and Photopost's BodyTag Preview.
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#255734 - 08/06/03 03:47 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: sf49rminer]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
Thanks for your quick replies to this thread.... Im sorry if I came off in a bad way - it wasnt my intention. I just felt after reading about how a few owners wanted ways to encorage people to sign up for thier sites, that this would be a perfect solution (or alternative)<br /><br />Im not usto posting on technical forums - Im usualy posting on forums about cars and such... so after reading technical forums for 5 years and now having this being only my 5 or so post, I fergot how some things take longer to receive replies to, than others....<br /><br />Im a n00b <br /><br />Thank you and best regards,<br />-isaac<br />

Top
#255735 - 08/06/03 04:26 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
You did not come off in any bad way at all. I hope you did not take my post in the wrong way. You posted twice in two days so I wanted to make sure you knew your options <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />I see Josh replied to this the same time I was writing my response before so cool deal.<br /><br />
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#255736 - 08/06/03 07:13 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: sf49rminer]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
Ok.... im working on this hack right now - its alot easier than I originaly thought it would be <br /> <br />Ill post up the changes when im done - it looks to only be a simple modification of... <br /> <br />
Code:
$postrow[$i]['BodyART'] = ($Body);
<br /> <br />
Code:
$postrow[$i]['BodyART'] = substr($Body,0,200);
<br /> <br />...in the showflat.php file <br /> <br />and changing the $body tag to $bodyART in your SHOWFLAT-ARTICLE.tmpl file(an add-on hack that can also be downloaded from ThreadsDEV - hack gives you anternative display for your tech articles) <br /> <br />now time to put in the if/then statements to ignore ADMIN/MOD/REG'd users and post a notice to all the unreged persons with a link to where they can register at. I might also add some intelegence so that it wont cut photos off in the middle of the URL, or text in the middle of a word <img src="/forum/images/graemlins/smile.gif" alt="" /> <br />


Edited by id242 (08/06/03 07:19 PM)

Top
#255737 - 08/06/03 08:00 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
You got it. <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />When you complete it, please write it up and post it here.<br /><br /><img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />To check if they are not logged in this will do the trick:<br /><br />if (!$user['U_Username']) {<br /> // Do the not logged in stuff<br />}<br /><br /><br />Also <br /><br />strip_tags($Body);<br /><br />is a simple tag that will strip the HTML stuff out (so a link or image doesn't break in the middle if it's gotten chopped of. :
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#255738 - 08/07/03 12:31 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: Daine]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
This is what I have, that Im currently playing off from... <br /> <br />
Code:
   if ( ($user['U_Status'] == "Administrator") || ($user['U_Status'] == "Moderator") || ($user['U_Status'] == "Users") ) { <br /> <br />     // Show Entire Message <br />		 $postrow[$i]['BodyART'] = ($Body); <br />     // Show Only X Amount of Chrs <br />	} else { <br />		 $postrow[$i]['BodyART'] = substr($Body,0,1000); <br />		 $postrow[$i]['BodyART'] = $postrow[$i]['BodyART'] . "...&lt;FONT COLOR=BLUE SIZE=2&gt;&lt;B&gt;&lt;I&gt;MORE&lt;/I&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;FONT COLOR=RED SIZE=3&gt;&lt;B&gt;...To view the rest of this article, please &lt;a href=http://www.everythingcelica.com/ubbthreads/newuser.php&gt;&lt;U&gt;Register&lt;/U&gt;&lt;/a&gt; for a new account.&lt;BR&gt; Or if you already have an account with us, &lt;a href=http://www.everythingcelica.com/ubbthreads/login.php&gt;&lt;U&gt;Login&lt;/U&gt;&lt;/a&gt; now.&lt;/B&gt;&lt;/FONT&gt;"; <br />	} <br />
<br /> <br />The strip_tags function that you mentioned above is nice, but it also removes the line-feeds and any photos if there happens to be a photo in the first few X amount of characters. <br /> <br />I've also oppted to use the more direct approch to finding if a person is a member or just unregistered - this leave options open for me to ban someone from use of the articles/guides just by removing from the three main cats of Admin/Mod/User ... and put them into "Other" category <br /> <br />I havent put much time into it since my last post, but im sure that because this is such a simple modification, it shall be done very soon <br /> <br />BTW - we normaly get about 10 new members/day and since including this to the site, we've aquiered about 24 new members in just the past 6 hours!!! Can someone say PB&J TIME! <img src="/forum/images/graemlins/smile.gif" alt="" />

Top
#255739 - 08/07/03 12:35 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Yay! <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />Glad it's working for you. <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#255740 - 08/07/03 12:36 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
I just gotta fix it so that it hits only the first post in the topic and none of the replies <img src="/forum/images/graemlins/smile.gif" alt="" /> also an option to show or not to show replies.<br /><br />then to put the "show X chars" and "show entire thread or only first post" into the admin modification variables box

Top
#255741 - 08/07/03 05:01 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
There you go. Thats why I suggested the Body Tag Preview Hack. <img src="/forum/images/graemlins/wink.gif" alt="" /><br /><br />Glad you got that. <img src="/forum/images/graemlins/wink.gif" alt="" />
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#255742 - 08/07/03 08:06 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: sf49rminer]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
I’m pretty much through working on it... I've done what I feel needs to be done with it<br /><br />in SHOWFLAT.php, I added ",B_Topic" to the end.<br /><br />to get...<br />
Code:
SELECT t1.B_Number,t2.U_Username,t1.B_Posted,t1.B_IP,t1.B_Subject,t1.B_Body,t1.B_File,t1.B_Status,t1.B_Approved,t2.U_Picture,t1.B_Reged,t2.U_Title,t2.U_Color,t1.B_Icon,t1.B_Poll,t1.B_Parent,t2.U_Status,t2.U_Signature,t1.B_LastEdit,t1.B_LastEditBy,t2.U_Location,t2.U_TotalPosts,t2.U_Registered,t2.U_Rating,t2.U_Rates,t2.U_RealRating,t2.U_PicWidth,t2.U_PicHeight,t2.U_Number,t1.B_FileCounter,t1.B_AnonName,B_Topic<br />
<br /><br />About 12 lines down, I added ",$btopic" to the string<br /><br />to get...<br />
Code:
      list ($Number,$Username,$Posted,$IP,$Subject,$Body,$File,$Open,$Approved,$Picture,$Reged,$Title,$Color,$Icon,$Poll,$ParentPost,$PostStatus,$Signature,$LastEdit,$LastEditBy,$Location,$TotalPosts,$Registered,$Rating,$Rates,$stars,$picwidth,$picheight,$usernum,$downloads,$anonname,$btopic) = $dbh -&gt; fetch_array($sth);
<br /><br />Towards the end of SHOWFLAT.php, after<br />
Code:
$postrow[$i]['Body'] = $Body;
<br /><br />I added...<br />
Code:
   if ($btopic) {<br />	   if ( ($user['U_Status'] == "Administrator") || ($user['U_Status'] == "Moderator") || ($user['U_Status'] == "Users") ) {<br />	     // Show Entire Message<br />			 $postrow[$i]['BodyART'] = ($Body);<br />	     // Show Only X Amount of Characters<br />		} else {<br />			 $postrow[$i]['BodyART'] = substr($Body,0,1000) . "&lt;img src=\"http://www.everythingcelica.com/ubb/blank.gif\"&gt;...&lt;FONT COLOR=BLUE SIZE=2&gt;&lt;B&gt;&lt;I&gt;MORE&lt;/I&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;TABLE WIDTH=98%&gt;&lt;TR&gt;&lt;TD&gt;&lt;CENTER&gt;&lt;FONT COLOR=RED SIZE=3&gt;&lt;B&gt;...To view the rest of this article, please &lt;a href=http://www.everythingcelica.com/ubbthreads/newuser.php&gt;&lt;U&gt;Register&lt;/U&gt;&lt;/a&gt; for a new account.&lt;BR&gt; Or if you already have an account with us, &lt;a href=http://www.everythingcelica.com/ubbthreads/login.php&gt;&lt;U&gt;Login&lt;/U&gt;&lt;/a&gt; now.&lt;/B&gt;&lt;/FONT&gt;&lt;/CENTER&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;";<br />		}<br />	} else {<br />	 $postrow[$i]['BodyART'] = ($Body);<br />	}<br />
<br />I used "1000" as a decent amount of text that we can show, without giving away everything for free <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />I also added the "blank.gif" image to the line because sometimes the texts gets truncated in the middle of an image - by adding a second image to the line, it seems to have fixed a "problem" and displays correctly across mozilla & iExplorer just fine. (blank.gif is the same thing as spacer.gif, which can be found in the images directory of your threads install... blank/spacer.gif is basically a 1x1 invisible background image - it does nothing unless you specify a length and width.... so for my purposes, it does nothing except solve a broken image issue from a url that might get truncated)<br /><br />The "Login/Register" text was put into it's own table so that I could get it centered without it messing with tables already in action (the truncated text might have lost a "table end" tag someplace - I prefer to not mess with that and just create my own tables <img src="/forum/images/graemlins/laugh.gif" alt="" />)<br /><br />And since i was feeling lazy - I didn’t feel like searching for a php tag for the site root. So i just entered what I knew was correct - replace your site URL where mine is at.<br /><br />in SHOWFLAT-ARTICLE.tmpl, i replace the $body tag with $bodyART<br /><br />ARTICLE TEMPLATES can be found at...<br />http://www.ubbdev.com/forum/showflat.php?Number=79420<br />

Top
#255743 - 08/07/03 08:53 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
Great work with this Isaac! Great idea! <img src="/forum/images/graemlins/waytogo.gif" alt="" /> <br /> <br />This is a great tool for sites that use a lot of articles, but how about limiting unregistered users to only see a certain amount of replies in a thread? <br />The last post could be a post from admin explaining that there are more replies but you must be registered and logged-in to read them.

Top
#255744 - 08/07/03 09:17 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
DLWebmaestro, "The last post could be a post from admin explaining that there are more replies but you must be registered and logged-in to read them." <br /> <br />This is already a feature of whats currently posted - I've added this comment to the end of the main article where it gets truncated... <br /> <br />And to add a feature where replies do not get shown - you just need to create... <br /> <br />
Code:
if (!$btopic) { <br />	   if ( ($user['U_Status'] == "Administrator") || ($user['U_Status'] == "Moderator") || ($user['U_Status'] == "Users") ) { <br />	     // Show Entire Message <br />			 $postrow[$i]['BodyART'] = ($Body); <br />	     // Replace replies with 'Please Register/Login' text <br />		} else { <br />			 $postrow[$i]['BodyART'] = "...To view this comment/reply, please &lt;a href=http://www.everythingcelica.com/ubbthreads/newuser.php&gt;&lt;U&gt;Register&lt;/U&gt;&lt;/a&gt; for a new account.&lt;BR&gt; Or if you already have an account with us, &lt;a href=http://www.everythingcelica.com/ubbthreads/login.php&gt;&lt;U&gt;Login&lt;/U&gt;&lt;/a&gt; now.&lt;/B&gt;"; <br />		} <br />	} else { <br />	 $postrow[$i]['BodyART'] = ($Body); <br />	}
<br /> <br />and add this under the code i've mentioned above....

Top
#255745 - 08/07/03 09:28 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
Where does the second "else" come in? It looks to see if you're an admin, mod, or user and if you are it serves the reply. Else, it gives the register text. What is the next "else" for? Also, does this replace each and every reply with the register text for guests, or just the first reply?<br /><br />

Top
#255746 - 08/07/03 09:33 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
$btopic = TOPIC (btopic is 1 or TRUE in the DB) <br />and <br />!$btopic = ALL REPLIES (btopic is 0 or FALSE in the DB) <br /> <br />The first IF statement just tells the difference between a TOPIC or a REPLY <br /> <br />The second IF statement tells it to display a full post if you are Admin/Mod/User and will only display a message if you are anything else (truncated TOPIC + message if its the TOPIC.... and message only, if its a reply)

Top
#255747 - 08/07/03 09:34 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
Ah...wait..I kind of see it....<br /><br />IF<br />..IF A<br />....THEN A1<br />....ELSE A2<br />..ELSE B

Top
#255748 - 08/07/03 09:36 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
Okay. So it's....<br /><br />IF (this is a reply)<br />..IF (member)<br />....THEN (show everything)<br />....ELSE (truncate)<br />..ELSE (show everything)<br /><br />Wow it's been a long time since I've flowcharted. <img src="/forum/images/graemlins/grin.gif" alt="" />

Top
#255749 - 08/07/03 09:39 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
the whole IF statement is just testing if the post is a TOPIC or REPLY and then dealing with it acordingly <img src="/forum/images/graemlins/smile.gif" alt="" /> <br /> <br />...this is why you can get two different NOTICES <br />TOPIC NOTICE = truncate and display, "there is more text, register if you want to read it" <br />REPLY NOTICE = "you cannot read this reply until your are registered" <br />(to be blunt <img src="/forum/images/graemlins/tongue.gif" alt="" />)

Top
#255750 - 08/07/03 09:42 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
You're saying that the option to add a topic notice is there, but that's not how you have the code, correct?<br /><br />Also, should I change 'BodyART' to 'Body' since I'm not using articles?

Top
#255751 - 08/07/03 09:44 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
And of course... this should probably be worked into showthreaded as well. <img src="/forum/images/graemlins/wink.gif" alt="" />

Top
#255752 - 08/07/03 09:50 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
if you are not using articles, just replace "$postrow[$i]['Body'] = ($Body);" with the two larger code snippets i've written above <br /> <br />both code snippets are different... the first one handles TOPICS and the second one does REPLIES <img src="/forum/images/graemlins/smile.gif" alt="" /> <br /> <br />Check - "if (!$btopic)" to see the main difference ( ! = NOT.... meaning, NOT TOPIC... aka, is REPLY) <br /> <br />Sorry, Im sure you deal with ALOT of kids on your site and need to explain things in detail - please do not mistake my detail as talking down to you, because it is in no way is that my intention - I too deal with alot of people on my site that requier detailed answers - so It just comes naturaly for me to try to cover all the details in one reply <img src="/forum/images/graemlins/smile.gif" alt="" />

Top
#255753 - 08/07/03 09:53 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
[]DLWebmaestro said:<br />And of course... this should probably be worked into showthreaded as well. <img src="/forum/images/graemlins/wink.gif" alt="" /> [/]<br /><br />showthreaded and printthread.... the install is all basically the same

Top
#255754 - 08/07/03 09:55 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
Here's some better code for the reply notice <img src="/forum/images/graemlins/wink.gif" alt="" /><br /><br />
Code:
<br />$postrow[$i]['Body'] = "...To view this comment/reply, please &lt;a href=\"{$config['phpurl']}/newuser.php\" /&gt;&lt;U&gt;Register&lt;/U&gt;&lt;/a&gt; for a new account.&lt;BR&gt; Or if you already have an account with us, &lt;a href=\"{$config['phpurl']}/login.php\" /&gt;&lt;U&gt;Login&lt;/U&gt;&lt;/a&gt; now.&lt;/B&gt;";

Top
#255755 - 08/07/03 10:01 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
excellent!

Top
#255756 - 08/07/03 10:07 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
And no offense taken. Details are good. <img src="/forum/images/graemlins/grin.gif" alt="" /> I have put this up on my site for now so you can check it out if you want. Some people might prefer that there only be one reply that states there are X amount of replies to this post...to read them...bla bla bla. Of course, this probably requires some difficult coding.

Top
#255757 - 08/07/03 10:17 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
the code for "NUMBER OF REPLIES" can be ripped from the SHOWFLAT.php - and stuck into the first bit of code that was posted above.

Top
#255758 - 08/07/03 10:28 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
I have added the ability to have it do this for select forums. Just replace A, B, and/or C with the keywords for the forums that you want to limit. You can use as many or as little as you like. Or, if you want to list the forums that you want it to NOT limit, replace == with !=.... I think. <img src="/forum/images/graemlins/grin.gif" alt="" /> <br /> <br />
Code:
 <br />   if ((!$btopic) &amp;&amp; (($Board == 'A') || ($Board == 'B') || $Board == 'C'))) { <br />		if ( ($user['U_Status'] == "Administrator") || ($user['U_Status'] == "Moderator") || ($user['U_Status'] == "Users") ) { <br />		// Show Entire Message <br />			$postrow[$i]['Body'] = ($Body); <br />		// Replace replies with 'Please Register/Login' text <br />			} else { <br />					$postrow[$i]['Body'] = "To view this comment/reply, please &lt;a href=\"{$config['phpurl']}/newuser.php\" /&gt;&lt;U&gt;Register&lt;/U&gt;&lt;/a&gt; for a new account.&lt;BR&gt; Or if you already have an account with us, &lt;a href=\"{$config['phpurl']}/login.php\" /&gt;&lt;U&gt;Login&lt;/U&gt;&lt;/a&gt; now.&lt;/B&gt;"; <br />			} <br />	} else { <br />	$postrow[$i]['Body'] = ($Body); <br />   } <br />


Edited by DLWebmaestro (08/07/03 10:49 AM)

Top
#255759 - 08/07/03 10:34 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
Okay...I don't think the exclusion list will work...only inclusion.

Top
#255760 - 08/07/03 10:53 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
You could even take things a step further and add the following to your "Config Settings" box at the bottom of the administrator's page...<br />
Code:
$config['articleboards'] =	'ubb15,ubb16,ubb17,ubb18,ubb19,ubb10,feat1,';
<br /><br />and then include "$Board == stristr(",{$config['articleboards']},", ",$Board,") instead of listing each board in the file - rather than having the edit the file each time you add new boards, just add the boards to your admin config options page<br /><br />(my usage of "stristr" should be correct - if not, I think that "SUBST($config['articleboards'])" might also do the trick - i might be getting EXCEL and PHP commands mixed???)

Top
#255761 - 08/07/03 12:01 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
There may be a slight misspelling in the mod code. My user group is 'User', not 'Users'. I am pretty sure this is the default. I was getting PMs left and right from users saying they were getting the register posts.

Top
#255762 - 08/07/03 12:06 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
I can't find postrow[$i]['Body'] = $Body; in showthreaded.... or anything else that signifies this.

Top
#255763 - 08/07/03 12:51 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
[]DLWebmaestro said: <br />There may be a slight misspelling in the mod code. My user group is 'User', not 'Users'. I am pretty sure this is the default. I was getting PMs left and right from users saying they were getting the register posts. [/] <br /> <br />intresting.... because I got the exact same response from my users for the past few hours, as you had - but I looked in my DB and thought this was correct (I guess I should have looked at the actual code, rather than whats displayed in the DB <img src="/forum/images/graemlins/grin.gif" alt="" /> .... this looks like a confusing bug from infopop in the 6.2x version of threads?) <br /> <br />Good find! - I just switched "Users" to "User" and things work like how they should!


Attachments
91100-screen.jpg (48 downloads)


Top
#255764 - 08/07/03 12:54 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
yes - U_Groups and User U_Status are entirely different things. The status is used for access to admin/moderator only stuff... and groups are used for forum access.... read/write permissions and such.
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#255765 - 08/07/03 01:00 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
[]DLWebmaestro said: <br />I can't find postrow[$i]['Body'] = $Body; in showthreaded.... or anything else that signifies this. [/] <br /> <br />just find... <br />
Code:
// -------------------------------------- <br />// Are there any replies to this message?
<br /> <br />and place the above code, above it <img src="/forum/images/graemlins/smile.gif" alt="" /> <br /> <br />.... <br /> <br />the string you are looking for, exists in printthreaded.php though.... so install to that should be simple enough

Top
#255766 - 08/07/03 01:03 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
[]JoshPet said:<br />yes - U_Groups and User U_Status are entirely different things. The status is used for access to admin/moderator only stuff... and groups are used for forum access.... read/write permissions and such. [/]<br /><br />does my statement of "my php skills are lacking" in the topic post, count as a disclaimer <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />Thanks Josh!!

Top
#255767 - 08/07/03 01:11 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
LOL<br /><br />No you are doing great! <img src="/forum/images/graemlins/smile.gif" alt="" /> Really - this is the best way to learn. And I definately see your confusion there. But you have tackled and accomplished something cool. Next thing you know you'll be a major hacker here. <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#255768 - 08/07/03 02:52 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: Daine]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
I'm not a major hacker yet. But with this post, I'm officially a Hacker. <img src="/forum/images/graemlins/grin.gif" alt="" />

Top
#255769 - 06/01/04 02:25 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
Deejay_dup1 Offline
Journeyman

Registered: 08/25/02
Posts: 106
Just wondering if you have had time to write this up as a official mod??? I am VERY interested in getting this going on my site... I have tons of guest users, that I wish would register.<br /><br />I tried to read through this thread, but seems a lot of hacking, and its a bit rough to follow.<br /><br />Can we get a step by step mod done up? That would be awesome. You are right in your first post... There are a lot of users who would like this mod! Its exactly what I was looking for.

Top
#255770 - 06/02/04 02:06 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: darenu]
Deejay_dup1 Offline
Journeyman

Registered: 08/25/02
Posts: 106
Ive checked both the celica and the drum sites, and didnt see this mod in action. Did you guys get it going live on your sites yet?<br /><br />I want! I want!! <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" />

Top
#255771 - 06/03/04 02:53 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: darenu]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
ITS BEEN UP AND RUNNING ON MY CELICA SITE SINCE THE DATE OF THIS WRITING..... ive even enhanced it a bit to not show attachments in all other forums for unreg'd users...<br /><br /><br />partial post for unreg'd....<br />http://www.everythingcelica.com/ubbthreads/thread.f_57266_0_collapsed_5__1.html#57266<br /><br /><br />no attached files for unreg'd...<br />http://www.everythingcelica.com/ubbthreads/thread.f_1862391965_13_collapsed_5__1.html#1862391965

Top
#255772 - 06/03/04 02:56 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
all the information need to implement this mod into your system is already posted in this thread.... <br /><br />I'm still trying to recover from a "look at me, I'm tony hawk" skateboard accident - so i wont be writing a detailed guide with this information anytime soon...<br />http://www.everythingcelica.com/ubbthreads/thread.f_1870020450_0_collapsed_5__1.html#1870020450

Top
#255773 - 06/03/04 05:17 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
Deejay_dup1 Offline
Journeyman

Registered: 08/25/02
Posts: 106
Hey, thanks for your post. Sorry to hear about your skate incident... I use to skate for years... (USE to.. <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /> ) <br /> <br />Well, still would if I still lived in Calgary.. Millennium skatepark was so awesome... <br /> <br />Anyways, back on topic... Thanks again for the update. I tried to follow and read through this topic, and there is too much things back and forth here for me to weed through, so I guess I would be outta luck.... <img src="http://www.ubbdev.com/forum/images/graemlins/frown.gif" alt="" /> <br /> <br />Maybe i will TRY to get it going, but it might take me a while. <br /> <br />And I did just now, notice you have this mod installed into your articles... doh! i was looking in your regular forums posts. <br /> <br /> <br />Deej

Top
#255774 - 06/03/04 06:10 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: darenu]
Deejay_dup1 Offline
Journeyman

Registered: 08/25/02
Posts: 106
Well, i couldn't just wait... hahah So i hacked it myself...<br /><br />Near the end of showflat.php where you did your mods, here is what I placed... This is how it looks in mine now:<br /><br /> // --------------------------<br /> // Are we ignoring this user?<br /> if (stristr($user['U_Ignored'],"-$usernum-")) {<br /> $postrow[$i]['Body'] = $ubbt_lang['IGNORING'];<br /> } else {<br /><br /> //-------------------------------------------<br /> // SHow only to reg users, mods, admins, and supporters<br /><br /> if ( ($user['U_Groups'] == "-5-") || ($user['U_Groups'] == "-6-") || ($user['U_Groups'] == "-7-") || ($user['U_Groups'] == "<br />-8-") || ($user['U_Status'] == "Administrator") || ($user['U_Status'] == "Moderator") || ($user['U_Status'] == "User") ) {<br /><br /> // Show Entire Message<br /> $postrow[$i]['Body'] = ($Body);<br /> }<br /><br /> // Show Only X Amount of Characters<br /> else {<br /> $postrow[$i]['Body'] = substr($Body,0,250) . "<br><Br><br><b>.... MORE</b><br><Br> To view the rest of this<br /> post, please <a href=\"http://www.atvcanada.ca/newuser.php\">click here to register for a FREE account.</a><br><Br>If you already h<br />ave an account with us, <a href=\"http://www.atvcanada.ca/login.php\">Login</a> now.";<br /> }<br /><br /> }<br /><br /><br /><br /> // -------------------------------------------------<br /> // Only certain options for users that are logged in<br /><br /><br /><br />Since I am not using articles, I just used it stock... The groups shown are my supporting groups, and I had to change "Users" to "User" for it to work on my board's reg'd users.<br /><br />Now all un-reged users will see the register message when they read ANY posts on my site... Mission accomplished... (Well, almost... Just have to mod showthreaded...)<br /><br />Deej

Top
#255775 - 06/03/04 06:50 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
Deejay_dup1 Offline
Journeyman

Registered: 08/25/02
Posts: 106
[]id242 said:<br />[]DLWebmaestro said:<br />I can't find postrow[$i]['Body'] = $Body; in showthreaded.... or anything else that signifies this. [/]<br /><br />just find...<br />
Code:
// --------------------------------------<br />// Are there any replies to this message?
<br /><br />and place the above code, above it <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />....<br /><br />the string you are looking for, exists in printthreaded.php though.... so install to that should be simple enough [/]<br /><br />I had the same problem, so i tried hacking in the code I mentioned in my last post... The stuff I put in showflat.php... And it didnt work right in printthread.php or anywhere in showthreaded.php that I tried?<br /><br /> <img src="http://www.ubbdev.com/forum/images/graemlins/smashpc.gif" alt="" />

Top
#255776 - 06/03/04 11:22 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: darenu]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
i just removed the ability for unreg'd users to print or email posts.... another tiny hack i dreamt up to solve that problem. <br /> <br />check my artciles, no print/email buttons <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /> log into an account and you will see them <br /> <br />threaded option is also OUT THE QUESTION for unreg'd...

Top
#255777 - 07/03/04 11:36 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: eslmix]
oceanwest Offline
Enthusiast

Registered: 04/25/02
Posts: 490
Loc: Escondido, CA
Anyone update this w/ instructions for 6.5?
_________________________
FM Forums
Largest Online FileMaker Community
http://www.fmforums.com

Top
#255778 - 07/03/04 11:53 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: sdf123]
id242_dup1 Offline
Member

Registered: 05/23/03
Posts: 159
Loc: Los Angeles
I'm actually working on a different approach for this - unreg'd uses will see full texts, but no inline images or links/linked images<br /><br />I'd like to make my site slightly more search-engine friendly <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />

Top
#255779 - 01/26/05 11:41 AM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
oceanwest Offline
Enthusiast

Registered: 04/25/02
Posts: 490
Loc: Escondido, CA
This has been working for me.. what if I want to instead show the entire first post but any replies would be be restricted and invite registration?
_________________________
FM Forums
Largest Online FileMaker Community
http://www.fmforums.com

Top
#255780 - 03/12/05 11:22 PM Re: Unregistered users only see first post and X amount of letters/chrs [Re: VickiSmith]
Tina Offline
User

Registered: 07/22/04
Posts: 45
Wonderful Mod... is this now official and can this be used with 6.5.1?
_________________________
Helping the lost & lonely one sweet soul at a time...

Top
Page 1 of 3 1 2 3 >



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks