1
here's a modification that i made for the PHP-Nuke news system sometime last year (when i was active in that community as intel352).
i'd like to see something similar implemented in the XOOPS news module. it provides a Read More dropdown link that has the rest of the article, instead of being directed to another page.
× close edit hex TEXT viewer: /nukebbmods.net/dropdownNewsMod.txt
1 /********************************************/
2 /* Drop-Down News Modification for PHP-Nuke */
3 /* Created by intel352 of NukeBBMods.net */
4 /* http://www.nukebbmods.net */
5 /* intel352@nukebbmods.net */
6 /********************************************/
7
8 INSTALLATION FOR DROP-DOWN NEWS MOD:
9
10 Files Affected:
11 includes/my_header.php
12 includes/javascript.php
13 modules/News/index.php
14
15
16 1. open includes/my_header.php, anywhere above ?>, add:
17
18 echo "<style type="text/css">n";
19 echo "<!--n";
20 echo ".leftborder {n";
21 echo " border-left: 1px solid;n";
22 echo " padding-left: 5px;n";
23 echo "}n";
24 echo "//-->n";
25 echo "</style>nn";
26
27
28 2. open includes/javascript.php, above ?>, add:
29
30 echo "<script language="JavaScript">n";
31 echo "<!--n";
32 echo "function hidetoggle (idtogg)n";
33 echo "{n";
34 echo " document.getElementById(idtogg).style.display =
(document.getElementById(idtogg).style.display == 'none') ? 'block' : 'none';n";
35 echo " return false;n";
36 echo "}n";
37 echo "//-->n";
38 echo "</script>nn";
39
40
41 3. open modules/News/index.php, around line 107 (inside 'function theindex'), search for:
42
43 if ($fullcount > 0 OR $c_count > 0 OR $articlecomm == 0 OR $acomm == 1) {
44 $morelink .= "$story_link<b>"._READMORE."</b></a> | ";
45 } else {
46 $morelink .= "";
47 }
48 if ($fullcount > 0) { $morelink .= "$totalcount "._BYTESMORE." | "; }
49
50 DELETE or COMMENT OUT that code
51
52 in the same function, find:
53
54 themeindex($aid, $informant, $datetime, $title, $counter, $topic, $hometext,
$notes, $morelink, $topicname, $topicimage, $topictext);
55
56 and BEFORE it, add:
57
58 if($fullcount>0)
59 {
60 $words = split(' ', $bodytext);
61 $word_counts = count($words);
62 $readmore = "[ <a href="/modules.php?name=News&file=article&sid=$s_sid&mode=&order=0&thold=0"
onclick="return hidetoggle('full$s_sid');"
onmouseover="window.status='Read More'; return true;" onmouseout="window.status=''; return true;">
<b>Read More</b> ($word_counts more words)</a> ]<span id="full$s_sid" class="leftborder"
style="display: none;"><blockquote>$bodytext</blockquote></span>";
63 $hometext = $hometext."<br><br>".stripslashes($readmore);
64 }
65
66
67 SAVE and CLOSE all files
68
69 that's it, cheers!