forked from realdigger/SMF-Garage
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ssi_garage_examples.php
659 lines (616 loc) · 42.3 KB
/
ssi_garage_examples.php
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
<?php
/**********************************************************************************
* ssi_garage_examples.php *
***********************************************************************************
* SMF Garage: Simple Machines Forum Garage (MOD) *
* =============================================================================== *
* Software Version: SMF Garage 2.3 *
* Install for: 2.0.9-2.0.99 *
* Original Developer: RRasco (http://www.smfgarage.com) *
* Copyright 2015 by: Bruno Alves ([email protected] *
* Copyright 2007-2011 by: SMF Garage (http://www.smfgarage.com) *
* RRasco ([email protected]) *
* phpBB Garage by: Esmond Poynton ([email protected]) *
***********************************************************************************
* See the "SMF_Garage_License.txt" file for details. *
* http://www.opensource.org/licenses/BSD-3-Clause *
**********************************************************************************/
$ssi_guest_access = false;
// Include the SSI file.
require(dirname(__FILE__) . '/SSI_Garage.php');
// Viewing the homepage sample?
if (isset($_GET['view']) && $_GET['view'] == 'home1')
{
template_homepage_sample1('output');
exit;
}
// Load the main template.
template_ssi_above();
?>
<h2>SMF SSI_Garage.php Functions</h2>
<p><strong>Current Version:</strong> 2.2</p>
<p>This file is used to demonstrate the capabilities of SSI_Garage.php using PHP include functions.</p>
<p>The examples show the include tag, then the results of it. Examples are separated by horizontal rules.</p>
<h2>Include Code</h2>
<p>To use SSI_Garage.php, add the following code to the very top of your page before the <html> tag on line 1:</p>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php require("<?php echo addslashes($user_info['is_admin'] ? realpath($boarddir . '/SSI_Garage.php') : 'SSI_Garage.php'); ?>"); ?></code>
<h2>Some notes on usage</h2>
<p>All the functions have an output method parameter. This can either be "echo" (the default) or "array"</p>
<p>If it is "echo", the function will act normally - otherwise, it will return an array containing information about the requested task. For example, it might return a list of vehicles for ssi_smfg_newestVehicles.</p>
<p>The functions displayed as code below were created to allow you to utilize shadowbox and the theme styles associated with your forum. They will not return any visible output, only includes so you may put them in your <head> tags. In order for shadowbox to work with SSI_Garage.php you <b><u>must</u></b> inlcude at least the javascript function. The CSS includes are required to utilize the SMF table style.</p>
<h2>Additional Guides & FAQ</h2>
<div id="sidenav" class="windowbg">
<span class="topslice"><span></span></span>
<div class="content">
<h2 id="functionlist">Function List</h2>
<h3>Includes</h3>
<ul>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_includes'); return false;">All Includes</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_css_includes'); return false;">CSS Includes</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_js_includes'); return false;">JS Includes</a></li>
</ul>
<h3>Blocks</h3>
<ul>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_featuredVehicle'); return false;">Featured Vehicle</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_garageStats'); return false;">Garage Stats</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_newestVehicles'); return false;">Newest Vehicles</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_lastUpdatedVehicles'); return false;">Updated Vehicles</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_newestMods'); return false;">Newest Mods</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_lastUpdatedMods'); return false;">Updated Mods</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_mostViews'); return false;">Most Views</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_mostModified'); return false;">Most Modified</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_mostSpent'); return false;">Most Spent</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_topQmile'); return false;">Top Quartermiles</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_topDyno'); return false;">Top Dynoruns</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_topLap'); return false;">Top Laps</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_topRated'); return false;">Top Rated</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_lastBlog'); return false;">Recent Blogs</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_lastService'); return false;">Recent Services</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_lastVideo'); return false;">Recent Videos</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_smfg_lastComment'); return false;">Recent Comments</a></li>
</ul>
<h2 id="other">Other</h2>
<ul>
<li><a href="#" onclick="toggleVisibleByClass('ssi_preview', false); return false;">Show all examples</a></li>
<li><a href="#" onclick="toggleVisibleByClass('ssi_preview', true); return false;">Hide all examples</a></li>
</ul>
</div>
<span class="botslice"><span></span></span>
</div>
<div id="preview" class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">
<!-- INCLUDES ITEMS -->
<div class="ssi_preview" id="ssi_smfg_includes">
<h2>JavaScript and CSS Includes</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_includes([<i>str</i> $output_method])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'return' - Will return output.
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_includes(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><pre><?php $ssi_includes = ssi_smfg_includes('return');
echo str_replace(array('<','>'),array('<','>'),$ssi_includes); flush(); ?></pre></div>
</div>
<div class="ssi_preview" id="ssi_smfg_css_includes">
<h2>CSS Includes</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_css_includes([<i>str</i> $output_method])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'return' - Will return output.
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_css_includes(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><pre><?php $ssi_includes = ssi_smfg_css_includes('return');
echo str_replace(array('<','>'),array('<','>'),$ssi_includes); flush(); ?></pre></div>
</div>
<div class="ssi_preview" id="ssi_smfg_js_includes">
<h2>JavaScript Includes</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_js_includes([<i>str</i> $output_method])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'return' - Will return output.
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_js_includes(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><pre><?php $ssi_includes = ssi_smfg_js_includes('return');
echo str_replace(array('<','>'),array('<','>'),$ssi_includes); flush(); ?></pre></div>
</div>
<!-- BLOCK ITEMS -->
<div class="ssi_preview" id="ssi_smfg_featuredVehicle">
<h2>Featured Vehicle</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_featuredVehicle([<i>int</i> $width [, <i>bool</i> $description [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$width</b> - <i>default</i>: '200'
<br />
<b>$description</b> - <i>default</i>: '1' - Disables feature vehicle description. (Description is now block title - cannot disable, but option remains as parameter)
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array:
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $featuredVehicle = ssi_smfg_featuredVehicle(200, 1, 'array'); flush(); print_R(str_replace(array('<','>'),array('<','>'),$featuredVehicle));?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_featuredVehicle(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_featuredVehicle(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_garageStats">
<h2>Garage Stats</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_garageStats([<i>int</i> $style [, <i>str</i> $output_method]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$style</b> - <i>default</i>: '0' - Table style.
<br />
<b>$style</b> - <i>other available</i>: '1' - TinyPortal style.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array:
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $garageStats = ssi_smfg_garageStats(0, 'array'); flush(); print_R($garageStats);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_garageStats(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_garageStats(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_newestVehicles">
<h2>Newest Vehicles</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_newestVehicles([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $newestVehicles = ssi_smfg_newestVehicles(1, 1, 'array'); flush(); print_R($newestVehicles);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_newestVehicles(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_newestVehicles(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_lastUpdatedVehicles">
<h2>Updated Vehicles</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_lastUpdatedVehicles([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $updatedVehicles = ssi_smfg_lastUpdatedVehicles(1, 1, 'array'); flush(); print_R($updatedVehicles);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_lastUpdatedVehicles(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_lastUpdatedVehicles(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_newestMods">
<h2>Newest Mods</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_newestMods([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $newestMods = ssi_smfg_newestMods(1, 1, 'array'); flush(); print_R($newestMods);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_newestMods(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_newestMods(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_lastUpdatedMods">
<h2>Updated Mods</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_lastUpdatedMods([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $updatedMods = ssi_smfg_lastUpdatedMods(1, 1, 'array'); flush(); print_R($updatedMods);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_lastUpdatedMods(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_lastUpdatedMods(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_mostViews">
<h2>Most Views</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_mostViews([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $mostViews = ssi_smfg_mostViews(1, 1, 'array'); flush(); print_R($mostViews);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_mostViews(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_mostViews(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_mostModified">
<h2>Most Modified</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_mostModified([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $mostModified = ssi_smfg_mostModified(1, 1, 'array'); flush(); print_R($mostModified);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_mostModified(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_mostModified(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_mostSpent">
<h2>Most Spent</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_mostSpent([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $mostSpent = ssi_smfg_mostSpent(1, 1, 'array'); flush(); print_R($mostSpent);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_mostSpent(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_mostSpent(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_topQmile">
<h2>Top Quartermiles</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_topQmile([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $topQmile = ssi_smfg_topQmile(1, 1, 'array'); flush(); print_R($topQmile);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_topQmile(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_topQmile(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_topDyno">
<h2>Top Dynoruns</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_topDyno([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $topDyno = ssi_smfg_topDyno(1, 1, 'array'); flush(); print_R($topDyno);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_topDyno(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_topDyno(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_topLap">
<h2>Top Laptimes</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_topLap([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $topLap = ssi_smfg_topLap(1, 1, 'array'); flush(); print_R($topLap);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_topLap(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_topLap(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_topRated">
<h2>Top Rated</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_topRated([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $topRated = ssi_smfg_topRated(1, 1, 'array'); flush(); print_R($topRated);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_topRated(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_topRated(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_lastBlog">
<h2>Recent Blogs</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_lastBlog([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $lastBlog = ssi_smfg_lastBlog(1, 1, 'array'); flush(); print_R($lastBlog);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_lastBlog(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_lastBlog(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_lastService">
<h2>Recent Services</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_lastService([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $lastService = ssi_smfg_lastService(1, 1, 'array'); flush(); print_R($lastService);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_lastService(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_lastService(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_lastVideo">
<h2>Recent Videos</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_lastVideo([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $lastVideo = ssi_smfg_lastVideo(1, 1, 'array'); flush(); print_R($lastVideo);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_lastVideo(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_lastVideo(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_smfg_lastComment">
<h2>Recent Comments</h2>
<h3>Usage</h3>
<div class="ssi_result">ssi_smfg_lastComment([<i>bool</i> $title [, <i>int</i> $limit [, <i>str</i> $output_method]]])</div>
<h3>Options</h3>
<div style='margin-left: 10px;'>
<b>$title</b> - <i>default</i>: '1' - Disables block title.
<br />
<b>$limit</b> - <i>default</i>: '5' - Number of items to return.
<br />
<b>$output_method</b> - <i>default</i>: 'echo' - Will echo output.
<br />
<b>$output_method</b> - <i>other available</i>: 'array' - Will return following array (<b>$limit</b> set to '1'):
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><pre><?php $lastComment = ssi_smfg_lastComment(1, 1, 'array'); flush(); print_R($lastComment);?></pre></code>
</div>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_smfg_lastComment(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_smfg_lastComment(); flush(); ?></div>
</div>
</div>
<span class="botslice"><span></span></span>
</div>
<?
template_ssi_below();
function template_ssi_above()
{
global $settings, $context, $scripturl;
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SMF 2.0 SSI_Garage.php Examples</title>
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/index.css?fin20" />
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js"></script>
<style type="text/css">
#wrapper
{
width: 90%;
}
#upper_section .user
{
height: 4em;
}
#upper_section .news
{
height: 80px;
}
#content_section
{
position: relative;
top: -20px;
}
#main_content_section h2
{
font-size: 1.5em;
border-bottom: solid 1px #d05800;
line-height: 1.5em;
margin: 0.5em 0;
color: #d05800;
}
#liftup
{
position: relative;
top: -70px;
padding: 1em 2em 1em 1em;
line-height: 1.6em;
}
#footer_section
{
position: relative;
top: -20px;
}
#sidenav
{
width: 210px;
float: left;
margin-right: 20px;
}
#sidenav ul
{
margin: 0 0 0 15px;
padding: 0;
list-style: none;
font-size: 90%;
}
#preview
{
margin-left: 230px;
}
.ssi_preview
{
margin-bottom: 1.5em;
}
.ssi_preview h3
{
margin: 1em 0 0.5em 0;
}
.ssi_result
{
background-color: #fff;
border: 1px solid #99a;
padding: 10px;
overflow: hidden;
}
</style>
<script type="text/javascript"><!-- // --><![CDATA[
var smf_scripturl = "', $scripturl, '";
var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "', $context['character_set'], '";
// Sets all ssi_preview class to hidden, then shows the one requested.
function showSSIBlock(elementID)
{
toggleVisibleByClass("ssi_preview", true);
document.getElementById(elementID).style.display = "block";
}
// Toggle visibility of all sections.
function toggleVisibleByClass(sClassName, bHide)
{
var oSections = document.getElementsByTagName("div");
for (var i = 0; i < oSections.length; i++)
{
if (oSections[i].className == null || oSections[i].className.indexOf(sClassName) == -1)
continue;
oSections[i].style.display = bHide ? "none" : "block";
}
}
// ]]></script>';
ssi_smfg_js_includes();
echo '
</head>
<body>
<div id="wrapper">
<div id="header"><div class="frame">
<div id="top_section">
<h1 class="forumtitle">SMF 2.0 SSI.php Examples</h1>
<img id="smflogo" src="Themes/default/images/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />
</div>
<div id="upper_section" class="middletext" style="overflow: hidden;">
<div class="user"></div>
<div class="news normaltext">
</div>
</div>
</div></div>
<div id="content_section"><div class="frame">
<div id="main_content_section">
<div id="liftup" class="flow_auto">';
}
function template_ssi_below()
{
global $time_start;
echo '
<script type="text/javascript"><!-- // --><![CDATA[
showSSIBlock("ssi_smfg_featuredVehicle");
// ]]></script>
</div>
</div>
</div></div>
<div id="footer_section"><div class="frame">
<div class="smalltext"><a href="http://www.simplemachines.org">Simple Machines Forum</a></div>
</div></div>
</div>
</body>
</html>';
}