Witam, Mam problem z wtyczką do EF IV no może bardziej z ją modyfikacją. Pobrałem sobie wtyczke pro_download_panel ze strony autora ( http://wibix.de/infusions/pro_download_pan...load.php?did=19 ) i mam zachciankę którą nie daje rade wykonać. A dokładnie chce aby zdjecia pliku były wyświetlane w pliku did.php a nie image.php. Chce mieć wszystko w kupie. Próbowałem przenosić skrypt wyświetlania obrazków do pliku theme.php (w tej wtyczce) Ale nie stety nic nie wyświetla tak jak by nie mógł czytać treści z bazy danych. Poniżej znajduje sie kod pliku theme.php:


  1. <?php
  2.  
  3. if(!defined('IN_FUSION')) {
  4. die;
  5. }
  6.  
  7.  
  8. function pdp_render_download($id, $data, $links, $files, $images, $old_data)
  9. {
  10. global $locale, $pdp;
  11.  
  12. $down_link = '';
  13. $old_ver = $old_data['version'];
  14.  
  15. if(!$data['can_download']) {
  16. $down_link = '';
  17. } elseif(!empty($old_data['down']) || !empty($old_data['link_extern'])) {
  18. $down_link = 'file.php?did='.$id.'&file_id=0';
  19. } elseif(count($files)) {
  20. $latest_download = $files[0];
  21. $down_link = 'file.php?did='.$id
  22. .'&file_id='.$latest_download['id'];
  23. $old_ver = $latest_download['ver'];
  24. $old_size = $latest_download['size'];
  25. }
  26.  
  27. if(!empty($data['pic'])) {
  28. $pic = $data['pic'];
  29. $pic_id = 0;
  30. } elseif(count($images)) {
  31. $first_pic = $images[0];
  32. $pic = $first_pic['url'];
  33. $pic_id = $first_pic['id'];
  34. } else {
  35. $pic = "";
  36. }
  37.  
  38. echo "
  39. <hr />
  40. <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  41. <tr>
  42. <td> </td>
  43. </tr>
  44. <tr>
  45. <td><span style='font-size:1.5em;'><strong>".$data['name']." $old_ver</strong></span></td>
  46. </tr>
  47. <tr>
  48. <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  49. <tr>
  50. <td width=\"185\">";
  51. if(empty($down_link)) {
  52. echo parseubb($pdp->settings['download_restricted']);
  53. } else {
  54. echo '
  55. <a href="'.$down_link.'" target="_blank" >D O W N L O A D</a>';
  56. }
  57.  
  58. echo '
  59. '."</td>
  60. <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  61. <tr>
  62. <td>";
  63. if($data['user_id']) {
  64. echo " <span style=\"color:#FFF; font-weight:bold;\">Dodał:</span> <a href='profile.php?id="
  65. .$data['user_id']."'>".$data['user_name']
  66. ."</a>";
  67. }
  68. echo "</td>
  69. <td><span style=\"color:#FFF; font-weight:bold;\">Dnia:</span> ".showdate("longdate", $data['mtime'])."</td>
  70. </tr>
  71. <tr>
  72. <td>";
  73. if(!empty($old_size)) {
  74. echo " <span style=\"color:#FFF; font-weight:bold;\">".$locale['PDP029'].":</span> ".$old_size." ";
  75. }
  76. echo "</td>
  77. <td><span style=\"color:#FFF; font-weight:bold;\"><a href=\"".$data['homepage']."\" target=\"_blank\">".$locale['PDP020']."</a></span></td>
  78. </tr>
  79. <tr>
  80. <td><span style=\"color:#FFF; font-weight:bold;\">".$locale['pdp_downloads']." ".$data['count']." razy.</span></td>
  81. <td align=\"right\" >";
  82. if(iPDP_BROKEN) {
  83. echo "<a href='broken.php?did=".$id."'><span style=\"color:#b70404; font-weight:bold;\">".$locale['PDP024']
  84. ."</span></a><br />";
  85. }
  86. echo "</td>
  87. </tr>
  88. </table>
  89. </td>
  90. </tr>
  91. </table>
  92. </td>
  93. </tr>
  94. </table><br />
  95. <div align=\"center>\">
  96. <br /><a href=\"image.php?did=".$id."&pic_id=".$pic_id."\">".$locale['PDP054']."</a>
  97. </div>
  98. <br />
  99.  
  100. <div style='clear:both;'></div>
  101. <hr />
  102. <div style='width:200px; float:right; margin-left:5px; margin-bottom:5px;'>
  103. <!--begin side details-->
  104. <table cellspacing='1' border='0' width='100%' class='tbl-border'>
  105. <tr>
  106. <th colspan='2' style='text-align:center;'>".$locale['PDP053']."</th>
  107. </tr>
  108. ";
  109. if(!empty($data['license'])) {
  110. echo '
  111. <tr class="tbl1">
  112. <td><strong>'.$locale['pdp_license'].':</strong></td>
  113. <td>'.$data['license'].'</td>
  114. </tr>';
  115. }
  116. if(!empty($data['copyright'])) {
  117. echo '
  118. <tr class="tbl1">
  119. <td><strong>'.$locale['pdp_copyright'].':</strong></td>
  120. <td>'.$data['copyright'].'</td>
  121. </tr>';
  122. }
  123. if(!empty($pic)) {
  124. echo '
  125. ';
  126. }
  127. if(!empty($data['homepage'])) {
  128. echo '
  129. ';
  130. }
  131. if($data['allow_notify']) {
  132. if($data['can_subscribe']) {
  133. $subscribe_action = " (<a href='include/do_did.php?did=".$id
  134. ."&subscibe=";
  135. if($data['is_subscribing']) {
  136. $subscribe_action .= "0'>".$locale['PDP060'];
  137. } else
  138. $subscribe_action .= "1'>".$locale['PDP059'];
  139. $subscribe_action .= "</a>)";
  140. } else {
  141. $subscribe_action = "";
  142. }
  143. echo "<tr>
  144. <td class='tbl1'><b>".$locale['PDP061'].":</b></td>
  145. <td class='tbl1'>".$data['subscibers'].$subscribe_action."</td>
  146. </tr>\n";
  147. }
  148. </table>
  149. <!--end side details-->
  150. </div>
  151. <div>".$data['desc']."</div>
  152.  
  153. <div style='clear:both;'></div>\n";
  154.  
  155.  
  156. // report broken downloads
  157. echo '<hr />
  158. <div align="right">';
  159.  
  160. // edit link
  161. if(count($links)) {
  162. echo '<strong>'.$locale['pdp_edit'].':</strong> [ '
  163. .implode(' | ', $links).' ]';
  164. }
  165. echo "</div>\n";
  166.  
  167.  
  168. // files
  169. if(count($files)) {
  170. echo '<strong>'.$locale['PDP200'].':</strong>
  171. <ul>';
  172. }
  173. foreach($files as $row) {
  174. echo '
  175. <li>'.showdate("shortdate", $row['timestamp'])
  176. ." - <b>".$row['ver']." - </b>";
  177. if($data['can_download']) {
  178. echo ' <a href="file.php?did='.$id
  179. .'&file_id='.$row['id'].'"'
  180. .' title="'.$row['url'].'">'
  181. .trimlink($row['url'], 40).'</a>';
  182. } else {
  183. echo trimlink($row['url'], 40);
  184. }
  185. echo ' (<span class="small2">'.$row['size'].' - '
  186. .$row['desc'].')</span>'
  187. // ."<img src='icons/"
  188. // .($data['is_external'] ? "external" : "download")
  189. // .".gif' alt='' border='0'></a> "
  190. .'</li>';
  191. }
  192. if(count($files)) {
  193. echo "</ul>\n";
  194. }
  195. }
  196.  
  197.  
  198.  
  199. function pdp_render_downs(&$downs, $rowstart, $per_page, $count, $link)
  200. {
  201. global $locale;
  202.  
  203. echo '<hr />';
  204.  
  205. if($count > $per_page) {
  206. $navi = makepagenav($rowstart, $per_page, $count, 3, $link);
  207. } else {
  208. $navi = '';
  209. }
  210.  
  211. echo $navi;
  212.  
  213. // <td class='tbl1' valign='top'>".$data['desc']."</td>
  214. echo '
  215. <table cellspacing="1" class="tbl-border" width="100%">
  216. <colgroup>
  217. <col width="75%" />
  218. <col width="25%" />
  219. </colgroup>
  220. <tbody>';
  221. foreach($downs as $data) {
  222. if($data['is_new']) {
  223. $new = ' <img src="icons/new.gif"'
  224. .' alt="'.$locale['pdp_new'].'" />';
  225. } else {
  226. $new = '';
  227. }
  228.  
  229. if($data['votes']) {
  230. $rating = $locale['PDP205'][intval($data['avg_vote'])]
  231. ." (".$data['votes']." ".$locale['PDP213'].")";
  232. } else {
  233. $rating = "-";
  234. }
  235.  
  236. $info = '
  237. <table border="0" width="100%">
  238. <colgroup>
  239. <col width="1%" />
  240. <col width="99%" />
  241. </colgroup>
  242. <tbody>';
  243. if($data['user_id']) {
  244. $info .= '
  245. <tr>
  246. <td><strong>'.$locale['PDP882'].':</strong></td>
  247. <td><a href="profile.php?id='.$data['user_id'].'">'
  248. .$data['user_name'].'</a></td>
  249. </tr>';
  250. }
  251. $info .= '
  252. <tr>
  253. <td><strong>'.$locale['PDP013'].':</strong></td>
  254. <td>'.showdate('shortdate', $data['mtime']).'</td>
  255. </tr>
  256. <tr>
  257. <td><strong>'.$locale['pdp_downloads'].':</strong></td>
  258. <td>'.$data['downloads'].'</td>
  259. </tr>
  260. <tr>
  261. <td><strong>'.$locale['PDP021'].':</strong></td>
  262. <td>'.$data['comments'].'</td>
  263. </tr>
  264. <tr>
  265. <td><strong>'.$locale['PDP224'].':</strong></td>
  266. <td>'.$rating.'</td>
  267. </tr>
  268. </tbody>
  269. </table>';
  270.  
  271. echo '
  272. <tr>
  273. <th colspan="2"><strong><a href="'.$data['href'].'">'
  274. .$data['name'].'</a></strong>'.$new.'</th>
  275. </tr>
  276. <tr class="tbl1">
  277. <td valign="top">'.$data['desc'].'</td>
  278. <td valign="top">'.$info.'</td>
  279. </tr>';
  280. }
  281. echo '
  282. </tbody>
  283. </table>';
  284.  
  285. echo $navi;
  286. }
  287.  
  288.  
  289. ?>


A to kod pliku image.php:
  1. <?php
  2.  
  3. require_once('include/common.php');
  4.  
  5.  
  6. if(!$download->id) {
  7. fallback('index.php');
  8. }
  9.  
  10.  
  11. if(isset($_GET['pic_id']) && isNum($_GET['pic_id'])) {
  12. $pic_id = $_GET['pic_id'];
  13. } else {
  14. $pic_id = 0;
  15. }
  16.  
  17.  
  18.  
  19. /****************************************************************************
  20.  * GUI
  21.  */
  22. opentable($download->data['dl_name']);
  23. <p>
  24. <a href="download.php?did='.$download->id.'">'.$locale['PDP026'].'</a>
  25. <p>';
  26.  
  27.  
  28. $links = array();
  29. $cur_pic = '';
  30.  
  31. if(!empty($download->data['dl_pic'])) {
  32. $links[] = '<a href="'.FUSION_SELF.'?did='.$download->id.'">'
  33. .$download->data['dl_name'].'</a>';
  34. $cur_pic = array(
  35. 'pic_id' => 0,
  36. 'pic_url' => $download->data['dl_pic'],
  37. 'pic_desc' => $download->data['dl_name'],
  38. );
  39. }
  40.  
  41.  
  42. $res = dbquery("SELECT pic_id, pic_url, pic_desc
  43. FROM ".DB_PDP_IMAGES."
  44. WHERE download_id='".$download->id."' AND pic_status='0'");
  45. while($data = dbarray($res)) {
  46. if($data['pic_id']==$pic_id) {
  47. $pic_id = $data['pic_id'];
  48. $cur_pic = $data;
  49. $data['pic_desc'] = "<strong>".$data['pic_desc'].'</strong>';
  50. }
  51.  
  52. $links[] = '<a href="'.FUSION_SELF."?did=".$download->id
  53. .'&pic_id='.$data['pic_id'].'">'
  54. .$data['pic_desc'].'</a>';
  55. }
  56.  
  57.  
  58. if(!is_array($cur_pic)) {
  59. $download->fallback_download();
  60. }
  61.  
  62.  
  63. <div style="text-align: center;">
  64. '.implode(' | ', $links).'
  65. <p>
  66. <img src="'
  67. .(!pdp_is_external($cur_pic['pic_url'])
  68. ? $pdp->settings['upload_image']
  69. : ''
  70. ).$cur_pic['pic_url'].'" alt="'.$cur_pic['pic_desc'].'" />
  71.  
  72. <p>'
  73. .$cur_pic['pic_desc'].'
  74. </p>
  75. </div>';
  76.  
  77.  
  78. closetable();
  79.  
  80.  
  81. require_once('include/die.php');
  82. ?>


link do wyglądu:http://julek.wh4u.pl/infusions/pro_downloa...el/download.php