Advertisement
Kinu-chan

Post Subject/Message in page title for Kusaba X

Jan 9th, 2013
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. [------ Post Subject/Message in page title for Kusaba X ------]
  2. This adds the Subject of a thread to the title of the thread page, if no subject is posted it uses the OP post message (truncated to 50 chars)
  3. e.g. /b/ - Cocksuckers Thread! or,
  4. /b/ - Hi /b/, I have a question about why my cock is so s...
  5. When you see things like *_board_page.tpl, "*" is every template type you use.
  6. So, let's begin:
  7.  
  8. 1. In global_board_header.tpl, remove or comment out:
  9. <title>{$title}</title>
  10.  
  11. 2. Then, *_board_page.tpl, right at the top, add:
  12. <head><title>{t}{$title}{/t}</title></head>
  13.  
  14. 3. Then, in *_thread.tpl, find:
  15. {if $post.parentid eq 0}
  16.  
  17. And right under it, add:
  18. {strip}
  19. {if $post.subject neq ''}
  20. {t}<head><title>/{$board.name}/ - {$post.subject}</title></head>{/t}
  21. {elseif $post.subject eq '' && $post.message neq "\n"}
  22. {t}<head><title>/{$board.name}/ - {$post.message|strip_tags|substr:0:50}...</title></head>{/t}
  23. {else}
  24. {t}<head><title>/{$board.name}/ - [Image Only]</title></head>{/t}
  25. {/if}
  26. {/strip}
  27.  
  28. And that's it!
  29.  
  30. -Thank jmyeom for the fix for [Image Only], he patched up a line of my suck ^-^
  31.  
  32. Let me know if you have any problems at mail@34pchan.org, or find me lurking kusabax.culnet.net/sup/ or 34pchan.org/s/ as either (=^・ェ・^=)!p3l2W3bRxk!!HmZQR2Lwyu or (=^・ェ・^=)!KinuB0nt8M
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement