Votre question

Editer un PHP en HTML

Tags :
  • Php
  • Programmation
Dernière réponse : dans Programmation
19 Octobre 2008 08:17:11

Bonjour, :hello: 
Je souhaite éditer ce script PHP en HTML pour qu'il soit compatible avec mon site web :
  1. ##############################################################
  2. ## MOD Title: Similar Topics
  3. ## MOD Author: Leuchte < mail@leuchte.net > http://www.leuchte.net
  4. ## MOD Description: This mod adds a table at the bottom of a thread and displays other threads that are silimar in topic.
  5. ##
  6. ## MOD Version: 1.0.1
  7. ##
  8. ## Installation Level: Easy
  9. ## Installation Time: 5 Minutes
  10. ## Files To Edit: 3
  11. ##
  12. ## lang_main.php
  13. ## viewtopic.php
  14. ## templates/subSilver/viewtopic_body.tpl
  15. ##
  16. ## Included Files: 0
  17. ##############################################################
  18. ## For Security Purposes, Please Check: http://www.leuchte.net/mods/ for the
  19. ## latest version of this MOD.
  20. ##
  21. ##############################################################
  22. ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
  23. ##############################################################
  24. ## MOD History:
  25. ##
  26. ## 2004-09-25 - Initial Release
  27. ##
  28. ##############################################################
  29. #
  30. #-----[ SQL ]------------------------------------------
  31. # Run the following command on your sql database (replace phpbb_ with your db prefix) before you edit the files!
  32. ALTER TABLE phpbb_topics ADD FULLTEXT (topic_title);
  33.  
  34. #
  35. #-----[ OPEN ]------------------------------------------
  36. #
  37. language/lang_english/lang_main.php
  38.  
  39. #
  40. #-----[ FIND ]------------------------------------------
  41. #
  42. ?>
  43.  
  44. #
  45. #-----[ BEFORE, ADD ]------------------------------------------
  46. #
  47. $lang['Similar'] = 'Similar Topics';
  48.  
  49. #
  50. #-----[ OPEN ]------------------------------------------
  51. #
  52. viewtopic.php
  53.  
  54. #
  55. #-----[ FIND ]------------------------------------------
  56. #
  57. //
  58. // Go ahead and pull all data for this topic
  59. //
  60.  
  61. #
  62. #-----[ BEFORE, ADD ]------------------------------------------
  63. #
  64. // Similar Topics
  65. $sql = "SELECT topic_id
  66. FROM ". TOPICS_TABLE ."
  67. WHERE topic_id != $topic_id
  68. AND MATCH (topic_title) AGAINST ('". addslashes($topic_title) ."')
  69. ORDER BY topic_time DESC LIMIT 0,5";
  70. if ( !($result = $db->sql_query($sql)) )
  71. {
  72. message_die(GENERAL_ERROR, "Could not get main information for similar topics", '', __LINE__, __FILE__, $sql);
  73. }
  74. $topics = array();
  75. while ( $row = $db->sql_fetchrow($result) )
  76. {
  77. $topics[] = $row;
  78. }
  79. $count_similar = count($topics);
  80. if ( $count_similar > 0 )
  81. {
  82. $template->assign_block_vars('similar', array(
  83. 'L_SIMILAR' => $lang['Similar'],
  84. 'L_TOPIC' => $lang['Topic'],
  85. 'L_AUTHOR' => $lang['Author'],
  86. 'L_FORUM' => $lang['Forum'],
  87. 'L_REPLIES' => $lang['Replies'],
  88. 'L_LAST_POST' => $lang['Posted'])
  89. );
  90.  
  91.  
  92. for($i = 0; $i < $count_similar; $i++)
  93. {
  94. $sql = "SELECT t.topic_type, t.topic_status, t.topic_id, t.topic_title, t.topic_time, t.topic_replies, t.topic_last_post_id, u.user_id, u.username, f.forum_id, f.forum_name, p.post_time, p.post_username
  95. FROM ". TOPICS_TABLE ." t, ". USERS_TABLE ." u, ". FORUMS_TABLE ." f, ". POSTS_TABLE ." p
  96. WHERE t.topic_id = '". $topics[$i]['topic_id'] ."'
  97. AND f.forum_id = t.forum_id
  98. AND p.topic_id = t.topic_id
  99. AND u.user_id = p.poster_id
  100. GROUP BY t.topic_id";
  101. if ( !($result = $db->sql_query($sql)) )
  102. {
  103. message_die(GENERAL_ERROR, "Could not get similar topics", '', __LINE__, __FILE__, $sql);
  104. }
  105.  
  106. while ( $row = $db->sql_fetchrow($result) )
  107. {
  108. $similar = $row;
  109.  
  110. $tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] .'_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] .'_t']) : array();
  111. $tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] .'_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] .'_f']) : array();
  112. $topic_type = ( $similar['topic_type'] == POST_ANNOUNCE ) ? $lang['Topic_Announcement'] .' ': '';
  113. $topic_type .= ( $similar['topic_type'] == POST_STICKY ) ? $lang['Topic_Sticky'] .' ': '';
  114. $topic_type .= ( $similar['topic_vote'] ) ? $lang['Topic_Poll'] .' ': '';
  115. $replies = $similar['topic_replies'];
  116.  
  117. if( $similar['topic_status'] == TOPIC_LOCKED )
  118. {
  119. $folder = $images['folder_locked'];
  120. $folder_new = $images['folder_locked_new'];
  121. }
  122. else if( $similar['topic_type'] == POST_ANNOUNCE )
  123. {
  124. $folder = $images['folder_announce'];
  125. $folder_new = $images['folder_announce_new'];
  126. }
  127. else if( $similar['topic_type'] == POST_GLOBAL_ANNOUNCE )
  128. {
  129. $folder = $images['folder_global_announce'];
  130. $folder_new = $images['folder_global_announce_new'];
  131. }
  132. else if( $similar['topic_type'] == POST_STICKY )
  133. {
  134. $folder = $images['folder_sticky'];
  135. $folder_new = $images['folder_sticky_new'];
  136. }
  137. else
  138. {
  139. if( $replies >= $board_config['hot_threshold'] )
  140. {
  141. $folder = $images['folder_hot'];
  142. $folder_new = $images['folder_hot_new'];
  143. }
  144. else
  145. {
  146. $folder = $images['folder'];
  147. $folder_new = $images['folder_new'];
  148. }
  149. }
  150. if( $userdata['session_logged_in'] )
  151. {
  152. if( $similar['post_time'] > $userdata['user_lastvisit'] )
  153. {
  154. if( !empty($tracking_topics) || !empty($tracking_forums) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] .'_f_all']) )
  155. {
  156. $unread_topics = true;
  157. if( !empty($tracking_topics[$topic_id]) )
  158. {
  159. if( $tracking_topics[$topic_id] >= $similar['post_time'] )
  160. {
  161. $unread_topics = false;
  162. }
  163. }
  164. if( !empty($tracking_forums[$forum_id]) )
  165. {
  166. if( $tracking_forums[$forum_id] >= $similar['post_time'] )
  167. {
  168. $unread_topics = false;
  169. }
  170. }
  171. if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] .'_f_all']) )
  172. {
  173. if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] .'_f_all'] >= $similar['post_time'] )
  174. {
  175. $unread_topics = false;
  176. }
  177. }
  178.  
  179. if( $unread_topics )
  180. {
  181. $folder_image = $folder_new;
  182. $folder_alt = $lang['New_posts'];
  183. $newest_img = '<a href="'. append_sid("viewtopic.$phpEx?". POST_TOPIC_URL ."=$topic_id&view=newest") .'"><img src="'. $images['icon_newest_reply'] .'" alt="'. $lang['View_newest_post'] .'" title="'. $lang['View_newest_post'] .'" border="0" /></a> ';
  184. }
  185. else
  186. {
  187. $folder_image = $folder;
  188. $folder_alt = ( $similar['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
  189. $newest_img = '';
  190. }
  191. }
  192. else
  193. {
  194. $folder_image = $folder_new;
  195. $folder_alt = ( $similar['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['New_posts'];
  196. $newest_img = '<a href="'. append_sid("viewtopic.$phpEx?". POST_TOPIC_URL ."=$topic_id&view=newest") .'"><img src="'. $images['icon_newest_reply'] .'" alt="'. $lang['View_newest_post'] .'" title="'. $lang['View_newest_post'] .'" border="0" /></a> ';
  197. }
  198. }
  199. else
  200. {
  201. $folder_image = $folder;
  202. $folder_alt = ( $similar['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
  203. $newest_img = '';
  204. }
  205. }
  206. else
  207. {
  208. $folder_image = $folder;
  209. $folder_alt = ( $similar['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
  210. $newest_img = '';
  211. }
  212.  
  213. $title = (strlen($similar['topic_title']) > 40) ? (substr($similar['topic_title'], 0, 37) . '...') : $similar['topic_title'];
  214. $topic_url = '<a href="'. append_sid("viewtopic.$phpEx?". POST_TOPIC_URL .'='. $similar['topic_id']) .'">'. $title . '</a>';
  215.  
  216. $author_url = append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $similar['user_id']);
  217.  
  218. $author = ( $similar['user_id'] != ANONYMOUS ) ? '<a href="'. append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $similar['user_id']) .'">'. $similar['username'] .'</a>' : ( ($similar['post_username'] != '' ) ? $similar['post_username'] : $lang['Guest'] );
  219.  
  220. $forum_url = append_sid("viewforum.$phpEx?f=". $similar['forum_id']);
  221. $forum = '<a href="'. $forum_url .'">'. $similar['forum_name'] .'</a>';
  222. $post_url = '<a href="'. append_sid("viewtopic.$phpEx?". POST_POST_URL .'='. $similar['topic_last_post_id']) .'#'. $similar['topic_last_post_id'] .'"><img src="'. $images['icon_latest_reply'] .'" alt="'. $lang['View_latest_post'] .'" title="'. $lang['View_latest_post'] .'" border="0" /></a>';
  223. $post_time = create_date($board_config['default_dateformat'], $similar['topic_time'], $board_config['board_timezone']);
  224.  
  225. $template->assign_block_vars('similar.topics', array(
  226. 'FOLDER' => $folder_image,
  227. 'ALT' => $folder_alt,
  228. 'TYPE' => $topic_type,
  229. 'TOPICS' => $topic_url,
  230. 'AUTHOR' => $author,
  231. 'FORUM' => $forum,
  232. 'REPLIES' => $replies,
  233. 'NEWEST' => $newest_img,
  234. 'POST_TIME' => $post_time,
  235. 'POST_URL' => $post_url)
  236. );
  237. } // while
  238. } // for $i
  239. } // if ( $count_similar > 0 )
  240.  
  241. #
  242. #-----[ OPEN ]------------------------------------------
  243. #
  244. templates/subSilver/viewtopic_body.tpl
  245.  
  246. #
  247. #-----[ FIND ]------------------------------------------
  248. #
  249. <td align="right" valign="top" nowrap="nowrap">{JUMPBOX}<span class="gensmall">{S_AUTH_LIST}</span></td>
  250. </tr>
  251. </table>
  252.  
  253. #
  254. #-----[ REPLACE, WITH ]------------------------------------------
  255. #
  256. <td align="right" valign="top" nowrap="nowrap">{JUMPBOX}<span class="gensmall">{S_AUTH_LIST}</span></td>
  257. </tr>
  258. <tr>
  259. <td width="100%" colspan="2" align="center">
  260. <br />
  261. <!-- BEGIN similar -->
  262. <table width="85%" cellspacing="1" cellpadding="4" border="0" align="center" class="forumline">
  263. <tr>
  264. <td class="catHead" colspan="6"><span class="genmed"><b>{similar.L_SIMILAR}</b></span></td>
  265. </tr>
  266. <tr>
  267. <th colspan="2">{similar.L_TOPIC}</th>
  268. <th>{similar.L_AUTHOR}</th>
  269. <th>{similar.L_FORUM}</th>
  270. <th>{similar.L_REPLIES}</th>
  271. <th>{similar.L_LAST_POST}</th>
  272. </tr>
  273. <!-- BEGIN topics -->
  274. <tr>
  275. <td class="row1" align="center"><span class="genmed"><img src="{similar.topics.FOLDER}" border="0" alt="{similar.topics.ALT}" title="{similar.topics.ALT}" /></span></td>
  276. <td class="row1" width="30%">{similar.topics.NEWEST}<span class="gensmall">{similar.topics.TYPE}</span> <span class="topictitle">{similar.topics.TOPICS}</span></td>
  277. <td class="row1" width="10%"><span class="genmed">{similar.topics.AUTHOR}</span></td>
  278. <td class="row1"><span class="genmed">{similar.topics.FORUM}</span></td>
  279. <td class="row1" width="15%" align="center"><span class="genmed">{similar.topics.REPLIES}</span></td>
  280. <td class="row1"><span class="genmed">{similar.topics.POST_TIME} {similar.topics.POST_URL}</span></td>
  281. </tr>
  282. <!-- END topics -->
  283. </table>
  284. <!-- END similar -->
  285. </td>
  286. </tr>
  287. </table>
  288.  
  289. #
  290. #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
  291. #
  292. # EoM

[#ff8d00]Merci beaucoup ![/#7f007f]
:bounce: 
A bientôt
@+

Autres pages sur : editer php html

19 Octobre 2008 12:27:14

Genre :
Free.fr
atspace.com
Je crois qu'il y a une liste des hébergements gratuits sur IDN
19 Octobre 2008 13:27:42

non il n'y en a pas mais sur gratis domaine tu peut avoir un domaine .fr gratuit en 2 mois en lisant les mails tu gagne des points et il t'offre un hébergeur.Mais pour faire ton site web je te conseil d'utiliser IziSpot très bon et gratuit voici un petit site fait avec http://*********/
Tom's guide dans le monde
  • Allemagne
  • Italie
  • Irlande
  • Royaume Uni
  • Etats Unis
Suivre Tom's Guide
Inscrivez-vous à la Newsletter
  • ajouter à twitter
  • ajouter à facebook
  • ajouter un flux RSS