1. Список говнокодов пользователя Phabyd

    Всего: 1

  2. PHP / Говнокод #9409

    +159

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    function ***_helper_form_alter(&$form, &$form_state, $form_id) {
      if(substr($form_id, -9) == 'node_form') {   //  Make sure this stuff only happens for node edit forms.
      	// make helpful menus items available for editors on season types
      	if(isset($form['#node']->type) && $form['#node']->type == 'season') {
        	$form['field_menu_items'][0]['#description'] = 'Cut and paste the text in the blue box below into field above for menu items.<br />
        	(You must have created and submitted the season first, and the links below should look like "/show-name/season-#/link".)<br />
        	Delete items you don\'t wish to appear: The second section of the code is for items below the dotted line.<br />
        	<div style="margin:15px;border:1px solid #0CA2FF;padding:10px;">
        	<li><a href="/'.$form['#node']->path.'/about">About</a></li&#62<br />
        	<li><a href="/'.$form['#node']->path.'/bios">Bios</a></li><br />
        	<li><a href="/'.$form['#node']->path.'/blogs">Blogs</a></li&#62<br />
        	<li><a href="/'.$form['#node']->path.'/episodes">Episodes</a></li><br />
        	<li><a href="/'.$form['#node']->path.'/games">Games</a></li&#62<br />
        	<li><a href="/'.$form['#node']->path.'/photos">Photos</a></li><br />
        	<li><a href="/'.$form['#node']->path.'/videos">Videos</a></li&#62<br /><br />
        	<!-- Use code below for additional menu items: --><br /><br />
        	</ul><ul class="season-extras"><br />
        	<li><a href="http://games.***.com/">Full URL needed if not on www.***.com</a></li&#62<br />
        	<li><a href="/top-chef/diet-dr-pepper-challenge">Dr. Pepper Challenge</a></li&#62<br />
        	<li><a href="/foodies/recipe-finder">Recipe Finder</a></li&#62<br /><br />
        	<!-- Use code below for the "flyout" navigation: --><br /><br />
        	<li><a href="/tweettracker">Talk</a><br />
              <ul> <br />
                <div class="separator" style="float: left;"><br />
                    <li><a href="/tweettracker">Tweet Tracker</a></li&#62<br />
                    <li><a href="/tweetbattle">Tweet Battles</a></li&#62<br />
                    <li><a href="/iwanttobeahousewife">Just Saying</a></li&#62<br />
                </div><br />
              </ul><br />
          </li><br />
    
        	</div>';
    
      	  }

    Вот такой вот "код" попался на глаза в новом проекте

    Phabyd, 13 Февраля 2012

    Комментарии (6)