summaryrefslogtreecommitdiff
path: root/htdocs/index.php
blob: 198a3091b335202094200ac40da8f1db9976586e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php
// the home page
require_once("include/init.inc");
require_once("scripts/include/script.inc");
require_once("tips/include/tip.inc");
require_once("news/include/news.inc");

// init caching
require_once("Cache/Lite/Output.php");
$options = array(
	'cacheDir' => '/tmp/persistent/vimcache/'
);
$cache = new Cache_Lite_Output($options);

$page_title = "welcome home";
$page_sid = "sid_index.php";
// $page_foot = "foot_index.php";
// $page_foot_top = "foot_top_index.php";
// $page_stat_counter = "yes";
$page_atomfeed = "http://feed43.com/vim-scripts.xml";

include("header.php");
?>

<?php

// report database problems
if(!$CONN){
?>
    <h1>Sourceforge Project Database Problems</h1>
<p>
<span class="newsdate">[<?=date('d-M-Y')?>]</span> 
Sourceforge is currently experiencing sporadic problems with their 
project database and web server. This means news, scripts and tips 
are currently unavailable. Thank you for your patience.
 (<i>Scott Johnston</i>) 
<br clear="all">
Another way to get to the scripts is through git on
<a href="http://vim-scripts.org/vim/scripts.html">github</a>.
</p>
<?php
}
?>

<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr>
    <td class="lightbg"><span class="txth1">&nbsp;&nbsp;News</span></td>
    <td nowrap class="lightbg" align="right"><small>&nbsp;Vim
<?php
include("version.txt")
?>
    is the current version&nbsp;</small></td>
</tr>
</table>


<?php
// Cache the news with a timeout of one hour.
// But when the database is down much, much longer.
if (!$CONN) {
  $cache->setLifeTime(999999);
} else {
  $cache->setLifeTime(3600);
}
if (!$cache->start('news')) {
  $news = getRecentNewsItems(3);
  for ($i = 0; $i < sizeof($news); $i++) {
    $news_data = $news[$i];
?>
    <h1><?=$news_data{"title"}?></h1>
    <p>
    <span class="newsdate">[<?=formatNewsDate($news_data{"creation_date"})?>]</span> 
    <?=$news_data{"news"}?>
     (<i><?=$news_data{"first_name"}?> <?=$news_data{"last_name"}?></i>) 
    <br clear="all">
    </p>
<?php
  }
  $cache->end();
}
?>

<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr>
<td><a href="news/news.php">more news...</a></td>
<td align="center">
Show you like Vim: get a T-shirt from <a href="http://www.freewear.org/?org=Vim">FreeWear</a>
</td>
<td align="center">
<a href="posters.php">Get a Vim poster</a>
</td>
</tr>
</table>

<?php
// Cache the script and tip lists with a timeout of ten minutes.
// But when the database is down much, much longer.
if (!$CONN) {
  $cache->setLifeTime(999999);
} else {
  $cache->setLifeTime(600);
}
if (!$cache->start('recentScripts')) {
?>

<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr><td colspan="2"><img src="<?=$IMAGES?>/spacer.gif" width="1" height="10" alt=""></td></tr>
<tr>
    <td class="lightbg"><span class="txth1">&nbsp;&nbsp;Recent Script Updates</span></td>
    <td nowrap class="lightbg" align="right"><small>&nbsp;<?=number_format(getScriptCount())?> scripts, <?=number_format(getTotalScriptDownloads())?> downloads&nbsp;</small></td>
</tr>
<tr><td colspan="2"><img src="<?=$IMAGES?>/spacer.gif" width="1" height="10" alt=""></td></tr>
</table>
<table cellpadding="0" cellspacing="0" border="0">
<?php
    $recent_scripts = getRecentScriptUpdates(5);
    for($i=0;$i<sizeof($recent_scripts);$i++){
        $script_data = $recent_scripts[$i];
?>
<tr>
    <td class="newsdate" nowrap valign="top">[<?=formatNewsDate($script_data{"creation_date"})?>]</td>
    <td>&nbsp;<a href="scripts/script.php?script_id=<?=$script_data{"script_id"}?>"><?=$script_data{"script_name"}?></a> : <?=escapeForHTML($script_data{"summary"})?></td>
</tr>
<tr>
    <td><img src="<?=$IMAGES?>/spacer.gif" width="1" height="1" alt=""></td>
    <td>(<?=$script_data{"script_version"}?>) <?=escapeForHTMLNoBreaks(limitStrLength($script_data{"version_comment"}))?> - <i><?=$script_data{"first_name"}?> <?=$script_data{"last_name"}?></i></td>
</tr>
<?php
    }
?>
<tr><td colspan="2"><img src="<?=$IMAGES?>/spacer.gif" width="1" height="10" alt=""></td></tr>
<tr><td colspan="2"><a href="scripts/index.php">more recent</a> | 
                    <a href="scripts/script_search_results.php?order_by=downloads">most downloaded</a> | 
                    <a href="scripts/script_search_results.php?order_by=rating">top rated</a></td></tr>
<tr><td colspan="2"><img src="<?=$IMAGES?>/spacer.gif" width="1" height="10" alt=""></td></tr>
</table>

<?php
  $cache->end();
}
?>

<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr><td colspan="2"><img src="<?=$IMAGES?>/spacer.gif" width="1" height="10" alt=""></td></tr>
<tr>
    <td class="lightbg"><span class="txth1">&nbsp;&nbsp;Vim Tips</span></td>
</tr>
<tr><td colspan="2"><img src="<?=$IMAGES?>/spacer.gif" width="1" height="10" alt=""></td></tr>
</table>
The tips are located on the
<a href="http://vim.wikia.com/wiki/Vim_Tips_Wiki">Vim Tips wiki</a>.
 This is a platform to exchange tips and tricks from and for Vim users.
<p>

<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr><td colspan="2"><img src="<?=$IMAGES?>/spacer.gif" width="1" height="10" alt=""></td></tr>
<tr>
    <td class="lightbg"><span class="txth1">&nbsp;&nbsp;Vim Patches</span></td>
</tr>
<tr><td colspan="2"><img src="<?=$IMAGES?>/spacer.gif" width="1" height="10" alt=""></td></tr>
</table>
A list of patches available for Vim can be found on the
<a href="http://groups.google.com/group/vim_dev/web/vim-patches">vim_dev maillist pages</a>.
These add new or improved features, at the cost of having to rebuild Vim.
<p>

<?php
$google_ads = "normal";
include("footer.php");
?>