Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.85 KB | None | 0 0
  1. <?php
  2. require_once 'simple_html_dom.php';
  3.     error_reporting(0);
  4. /**
  5. *
  6. * @package phpBB3
  7. * @version $Id: applciation.php,v1.0.0 2010/09/05 2:43 PM PPCW2 Exp $
  8. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  9. *
  10. */
  11.  
  12. /**
  13. * @ignore
  14. */
  15.  
  16. define('IN_PHPBB', true);
  17. $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
  18. $phpbb_admin_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
  19. $phpEx = substr(strrchr(__FILE__, '.'), 1);
  20. include($phpbb_root_path . 'common.' . $phpEx);
  21. include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
  22. include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
  23. include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
  24.  
  25. // Start session management
  26. $user->session_begin();
  27. $auth->acl($user->data);
  28. $user->setup('common');
  29.  
  30.  
  31. $link = request_var('link', '');
  32.  
  33. $html = file_get_html(''.$link.'');
  34.          foreach($html->find('div[id=movie-main-image-container]') as $foto){
  35.             $img = $foto->find('a',0)->href;
  36.          }
  37.          foreach($html->find('div[id=mt-content-cell]') as $tituloespanol){
  38.             $titulo = $tituloespanol->find('span',0)->find('text',0)->plaintext;
  39.          }
  40.          
  41.  
  42.  
  43.          foreach($html->find('div[id=left-column]') as $info){
  44.             $year = $info->find('dd',1)->plaintext;
  45.             $reparto = $info->find('dd',8)->plaintext;
  46.             $genero = $info->find('dd',10)->plaintext;
  47.             $sinopsis = array_pop($info->find('dl',0)->find('dd'))->plaintext;
  48.          }
  49.              
  50.          foreach($html->find('div[id=movie-rat-avg]') as $calificacion){
  51.             $votos = $calificacion->find('text',0)->plaintext;
  52.          }
  53.    
  54.           $titulin = utf8_encode($titulo);
  55.           $ano = utf8_encode($year);
  56.           $repart = utf8_encode($reparto);
  57.           $gen = utf8_encode($genero);
  58.           $sinop = utf8_encode($sinopsis);
  59.           $vot = utf8_encode($votos);
  60.  
  61.          
  62. $message = "
  63. [centrar][rimg]$img [/rimg][/centrar]
  64.  
  65. [size=150][color=#400080][b]Sinopsis:[/b][/color][/size] $sinop
  66.  
  67. [size=150][color=#400080][b]Reparto:[/b][/color][/size] $repart
  68.  
  69. [size=150][color=#400080][b]Género:[/b][/color][/size] $gen
  70.  
  71. [size=150][color=#400080][b]Ficha De La Película:[/b][/color][/size] $link
  72.  
  73. [Calificacion] $vot [/Calificacion]
  74.  
  75. ";
  76.  
  77.  
  78. $time = time();
  79. $rawsubject = "$titulin"; // subject of the newly made thread
  80. $my_subject   = utf8_normalize_nfc($rawsubject, '', true);
  81. $my_text   = utf8_normalize_nfc($message, '', true);
  82. $forum_id = $_POST['forum_id'];
  83.  
  84. // variables to hold the parameters for submit_post
  85. $poll = $uid = $bitfield = $options = '';
  86.  
  87. generate_text_for_storage($my_subject, $uid, $bitfield, $options, false, false, false);
  88. generate_text_for_storage($my_text, $uid, $bitfield, $options, true, true, true);
  89.  
  90. $data = array(
  91.        'forum_id'      =>  $forum_id,
  92.        'icon_id'      => false,
  93.  
  94.        'enable_bbcode'      => true,
  95.        'enable_smilies'   => true,
  96.        'enable_urls'      => true,
  97.        'enable_sig'      => true,
  98.  
  99.        'message'      => $my_text,
  100.        'message_md5'   => md5($my_text),
  101.                
  102.        'bbcode_bitfield'   => $bitfield,
  103.        'bbcode_uid'      => $uid,
  104.  
  105.        'post_edit_locked'   => 0,
  106.        'topic_title'      => $my_subject,
  107.        'notify_set'      => false,
  108.        'notify'         => false,
  109.        'post_time'       => 0,
  110.        'forum_name'      => '',
  111.        'enable_indexing'   => true,
  112.  
  113. );
  114.  
  115. submit_post('post', $my_subject, $user->data['username'], POST_NORMAL, $poll, $data);
  116. $redirect_url = append_sid("{$phpbb_root_path}/viewforum.$phpEx?f=$forum_id", false, true, $user->session_id);
  117. meta_refresh(2, $redirect_url);
  118. trigger_error('Application Posted' . '<br /><br />Taking you back to the forum ' . sprintf('<a href="' . $redirect_url . '">', '</a>'));
  119. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement