vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Long Posts Edit. (https://vborg.vbsupport.ru/showthread.php?t=206703)

Shana 02-26-2009 04:17 PM

Long Posts Edit.
 
Hey, just wondering if I could somehow make it so if someones post is longer then 4 lines it adds something at th end like 'LONG POST'?

Lynne 02-26-2009 04:20 PM

How would you count '4 lines'? If you open your browser window up, the line gets longer.

Shana 02-26-2009 04:21 PM

I didn't think of that, would it be easier to do if it was x words or x letters? Like, if it's more then 200 words.

Lynne 02-26-2009 04:51 PM

Probably. But, I now picture a long post having the words LONG POST at the bottom of the post and wonder what the purpose of that is except that it makes the post even longer. :confused:

Shana 02-26-2009 05:40 PM

Any idea as to how I could do it? I just said 'LONG POST', it would be something else but I don't think it's appropriate for these forums <_<. Would be "disregard that ...." and if you know it you'll fill in the blank.

Lynne 02-26-2009 09:06 PM

Well, you'll have to create a plugin which checks the length of the $post[message] and then if it's longer than xx, you would append "LONG POST" (keeping with the example) to the end.

PHP Code:

if (strlen($post[message]) > '200'
$post[message] = $post[message] . "LONG POST"

I'm not sure of the plugin location or variable names (you can look them up in newpost.php file).

Dismounted 02-27-2009 11:03 AM

PHP Code:

// count lines -- see, it can be done!
$linecount count(explode('<br />'$post['message']));

// check lines
if ($linecount 4)
{
    
$post['message'] .= 'Long Post!';



Lynne 02-27-2009 02:54 PM

But then you are counting on line breaks inserted by the user, no? So they can write a huge paragraph and it would just be considered one line? I guess the OP can try the code and see how it works.


All times are GMT. The time now is 08:14 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01045 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete