 |
 |
 |
 |
#255742 - 08/07/03 08:06 AM
Re: Unregistered users only see first post and X amount of letters/chrs
[Re: sf49rminer]
|
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 /> 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 /> 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 -> fetch_array($sth); <br /><br />Towards the end of SHOWFLAT.php, after<br /> $postrow[$i]['Body'] = $Body; <br /><br />I added...<br /> 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) . "<img src=\"http://www.everythingcelica.com/ubb/blank.gif\">...<FONT COLOR=BLUE SIZE=2><B><I>MORE</I></B></FONT><BR><BR><TABLE WIDTH=98%><TR><TD><CENTER><FONT COLOR=RED SIZE=3><B>...To view the rest of this article, please <a href=http://www.everythingcelica.com/ubbthreads/newuser.php><U>Register</U></a> for a new account.<BR> Or if you already have an account with us, <a href=http://www.everythingcelica.com/ubbthreads/login.php><U>Login</U></a> now.</B></FONT></CENTER></TD></TR></TABLE>";<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
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#255755 - 08/07/03 10:01 AM
Re: Unregistered users only see first post and X amount of letters/chrs
[Re: eslmix]
|
Member
Registered: 05/23/03
Posts: 159
Loc: Los Angeles
|
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#255760 - 08/07/03 10:53 AM
Re: Unregistered users only see first post and X amount of letters/chrs
[Re: eslmix]
|
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 /> $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
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#255774 - 06/03/04 06:10 PM
Re: Unregistered users only see first post and X amount of letters/chrs
[Re: darenu]
|
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
|
|
|
|
 |
 |
 |
 |
|
|