Browse the code

 

Differences between 603 and 604 on /.
Number of edited files: 3 (0 added, 0 deleted and 3 modified)
Revision 604

About 5 days and 0 hour ago.

* Started work on project module homepage
Added file(s) Deleted file(s) Modified file(s)

 

Old New Code
214
214
/**
215
215
 * Generate an unique identifier
216
216
 *
217
 
 * Generate an identifier based on all ASCII characters or only on 
 
217
 * Generate an identifier based on all ASCII characters or only on
218
218
 * alphanumeric characters.
219
219
 *
220
220
 * @param $ascii (optional)
281
281
 */
282
282
function getUser($id, $db, $loadby=FALSE)
283
283
{
284
 
    require_once(CT_BASEDIR.'/inc/modules/users/models/user.php');    
 
284
    require_once(CT_BASEDIR.'/inc/modules/users/models/user.php');
285
285
    $user = new User($db);
286
286

                                        
287
287
    if (!$loadby)
537
537
            $d['day'] = mb_substr($date, 8, 2);
538
538
            $d['month'] = mb_substr($date, 5, 2);
539
539
            $d['year'] = mb_substr($date, 0, 4);
540
 
            $c = explode(' ', $date); 
 
540
            $c = explode(' ', $date);
541
541

                                        
542
542
            $hours = ((isset($c[1])) ? $c[1] : '');
543
543

                                        
606
606
    // Input date is a datetime
607
607
    if ($in == 'datetime')
608
608
    {
609
 
        // Ouput date is RFC-822 compliant 
 
609
        // Ouput date is RFC-822 compliant
610
610
        if ($out == 'rfc')
611
611
        {
612
612
            list($date, $hours) = explode(' ', $date);
681
681
 * Truncate a string
682
682
 *
683
683
 * Truncate a string with a certain number of allowed characters and
684
 
 * put a `…` after the string. 
 
684
 * put a `…` after the string.
685
685
 *
686
686
 * @param $str
687
687
 *   The string.
765
765
/**
766
766
 * Verifiy the level of the user
767
767
 *
768
 
 * Exit with a 401 HTTP code if the level of the user is not the wished one. 
 
768
 * Exit with a 401 HTTP code if the level of the user is not the wished one.
769
769
 *
770
770
 * @param $user_id
771
771
 *   The database id of the user.
869
869
/**
870
870
 * Test the level
871
871
 *
872
 
 * Test if the level of the user is the wished one. 
 
872
 * Test if the level of the user is the wished one.
873
873
 *
874
874
 * @param $user_id
875
875
 *   The database id of the user.
898
898
/**
899
899
 * Test affiliation
900
900
 *
901
 
 * Test if the user is affiliated with the project as a project administrator. 
 
901
 * Test if the user is affiliated with the project as a project administrator.
902
902
 *
903
903
 * @param $user_id
904
904
 *   The database id of the user.
963
963
/**
964
964
 * Delete a cached page
965
965
 *
966
 
 * Delete the version of a page stored in the cache. 
 
966
 * Delete the version of a page stored in the cache.
967
967
 *
968
968
 * @param $pagetag
969
969
 *   Often $this->page (in module's views).
1052
1052
        $size /= 1024;
1053
1053

                                        
1054
1054
    return round($size, 0).' '.$sizes[$i];
1055
 
} 
 
1055
}
1056
1056

                                        
1057
1057

                                        
1058
1058
/**
1059
1059
 * Crypt a mail/jabber id (fight SPAM)
1060
1060
 *
1061
 
 * 
 
1061
 *
1062
1062
 * @param $mail
1063
1063
 *   The mail to crypt
1064
1064
 */
1392
1392
        $last_hash = explode('/', $last_element)[1];
1393
1393

                                        
1394
1394
        $current_datetime = date('Y-m-d');
1395
 
        $days = (int)floor((strtotime($current_datetime) - 
 
1395
        $days = (int)floor((strtotime($current_datetime) -
1396
1396
                            strtotime($last_datetime))/86400);
1397
1397

                                        
1398
1398
        if ($days == 0)
1552
1552
        case 'default':
1553
1553
            // Show: avatar, nickname, name
1554
1554
            // Can be used for unregistered users as well.
1555
 
            $return = '<img src="'.$user_avatar.'" alt="'.$user_nick.'" '.
1556
 
                      'style="width: 32px;height: 32px;float: left;'.
1557
 
                      'padding: 2px 5px 2px 2px;" />'.
 
1555
            $return = '<div class="user-avatar-default">
 
1556
                         <img src="'.$user_avatar.'" alt="'.$user_nick.'"/>
 
1557
                         <strong>'.$user_name.'</strong>
 
1558
                         <br />'.
1558
1559
                      (($user_registered) ?
1559
1560
                        '<a href="users/show/'.$user_nick.'">' : '').
1560
 
                      '<strong>'.$user_nick.'</strong>'.
 
1561
                      '@'.$user_nick.
1561
1562
                      (($user_registered) ?
1562
 
                        '</a>' : '').
1563
 
                      '<br /><span class="text_minus">'.$user_name.'</span>';
 
1563
                        '</a>' : '').'
 
1564
                       </div>';
1564
1565
        break;
1565
1566

                                        
1566
1567
        case 'increase':
1567
1568

                                        

 

Old New Code
1
1
<div class="content_left_main">
2
2

                                        
 
3
  <h1><?=$_name;?></h1>
 
4

                                    
3
5
  <div class="bigtext">
4
6
    <?=$_text;?>
5
7
  </div>
78
80
        <p><strong><?=i18n('Tags:');?></strong></p>
79
81
        <div class="tags">
80
82
          <? foreach ($_tags as $tag): ?>
81
 
            <p><a href="index/default/tags/<?=$tag[0];?>"><span><?=$tag[1];?></span></a></p>
 
83
            <p><a href="index/default/tags/<?=$tag[0];?>"><i class="fas fa-tag fa-fw"></i><span><?=$tag[1];?></span></a></p>
82
84
          <? endforeach; ?>
83
85
        </div>
84
86
      </td>
123
125
  <h2 style="margin-top: -5px;"><?=i18n('Get involved');?></h2>
124
126
  <ul class="actiontools">
125
127
    <? if ($donation): ?>
126
 
      <li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=<?=$donation['id'];?>&amp;item_name=<?=$_name;?>%20Donation&amp;no_shipping=1&amp;no_note=1&amp;tax=0&amp;currency_code=<?=$donation['cur'];?>&amp;bn=PP%2dDonationsBF&amp;charset=UTF%2d8" style="background-image: url('public/images/icons/project-donate.png');">
127
 
        <?=i18n('Make a donation');?></a></li>
 
128
      <li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=<?=$donation['id'];?>&amp;item_name=<?=$_name;?>%20Donation&amp;no_shipping=1&amp;no_note=1&amp;tax=0&amp;currency_code=<?=$donation['cur'];?>&amp;bn=PP%2dDonationsBF&amp;charset=UTF%2d8">
 
129
        <i class="fas fa-credit-card fa-fw"></i><?=i18n('Make a donation');?></a></li>
128
130
    <? endif; ?>
129
131
    <? if ($_feat_act['bugs']): ?>
130
 
      <li><a href="project/<?=$_dbname;?>/bugs/add" style="background-image: url('public/images/icons/project-bug.png');"><?=i18n('Report a bug');?></a></li>
 
132
      <li><a href="project/<?=$_dbname;?>/bugs/add"><i class="fas fa-bug fa-fw"></i><?=i18n('Report a bug');?></a></li>
131
133
    <? endif; ?>
132
134
    <? if ($_feat_act['forum']): ?>
133
 
      <li><a href="project/<?=$_dbname;?>/forum/add" style="background-image: url('public/images/icons/project-forum.png');"><?=i18n('Post a new topic');?></a></li>
 
135
      <li><a href="project/<?=$_dbname;?>/forum/add"><i class="fas fa-comments fa-fw"></i><?=i18n('Post a new topic');?></a></li>
134
136
    <? endif; ?>
135
137
    <? if ($_feat_act['i18n']): ?>
136
 
      <li><a href="project/<?=$_dbname;?>/i18n" style="background-image: url('public/images/icons/project-i18n.png');"><?=i18n('Help translate');?></a></li>
 
138
      <li><a href="project/<?=$_dbname;?>/i18n"><i class="fas fa-globe-africa fa-fw"></i><?=i18n('Help translate');?></a></li>
137
139
    <? endif; ?>
138
140
    <? if ($_feat_act['browse']): ?>
139
 
      <li><a href="project/<?=$_dbname;?>/browse" style="background-image: url('public/images/icons/project-code.png');"><?=i18n('Get the sources');?></a></li>
 
141
      <li><a href="project/<?=$_dbname;?>/browse"><i class="fas fa-terminal fa-fw"></i><?=i18n('Get the sources');?></a></li>
140
142
    <? endif; ?>
141
143
  </ul>
142
144

                                        
143
145

                                        

 

Old New Code
1
 
/* CONTENT ORGANIZATION
 
1
/* CONTENT ORGANIZATION */
2
2
div.content_left {
3
3
  width: 49%;
4
4
  float: left;
18
18
div.content_right {
19
19
  width: 49%;
20
20
  margin-left: 51%;
21
 
}*/
 
21
}
22
22

                                        
23
23

                                        
24
24
/* MULTICOLORED GRIDS */
195
195

                                        
196
196
#page h1 {
197
197
  margin-top: 0px;
198
 
  font-size: 1.6em;
 
198
  font-size: 2.0em;
 
199
  margin-bottom: 15px;
 
200
  text-transform: uppercase;
 
201
  font-weight: 400;
199
202
}
200
203

                                        
201
204
#page h2 {
295
298
}
296
299

                                        
297
300
#page ul.actiontools li a, #page input.actionbutton {
298
 
  padding: 8px 5px 8px 30px;
 
301
  padding: 8px 5px 8px 5px;
299
302
  display: block;
300
303
  font-weight: bold;
301
 
  background-repeat: no-repeat;
302
 
  background-position: 5px 50%;
303
304
}
304
305

                                        
305
306
#page ul.actiontools li a:hover, #page input.actionbutton:hover {
307
308
  color: {color_400};
308
309
}
309
310

                                        
 
311
#page ul.actiontools li a i {
 
312
  margin-right: 10px;
 
313
}
310
314

                                        
 
315

                                    
311
316
/* TAGS */
312
317
#page div.tags {
313
318
  padding-left: 10px;
326
331
}
327
332

                                        
328
333
#page div.tags a {
329
 
  color: {color_400};
 
334
  color: {color_600};
330
335
  display: block;
331
336
}
332
337

                                        
 
338
#page div.tags i {
 
339
  color: {color_600};
 
340
}
 
341

                                    
333
342
#page div.tags a:hover {
334
343
  text-decoration: none;
335
344
}
336
345

                                        
337
346
#page div.tags p:hover {
338
 
  background-color: {color_100};
 
347
  background-color: {color_200};
339
348
}
340
349

                                        
341
350
#page div.tags p:hover:before {
342
 
  border-right: 10px solid {color_100};
 
351
  border-right: 10px solid {color_200};
343
352
}
344
353

                                        
345
354
#page div.tags p:before {
346
 
  border-top: 11px solid transparent;
 
355
  border-top: 13px solid transparent;
347
356
  border-right: 10px solid {color_100};
348
 
  border-bottom: 11px solid transparent;
 
357
  border-bottom: 13px solid transparent;
349
358
  content: "";
350
359
  height: 0;
351
360
  position: absolute;
356
365
  transition-property: border-right;
357
366
}
358
367

                                        
359
 
#page div.tags a:before {
360
 
  background: url('../../../public/images/icons/project-tag.png') no-repeat 0px 0px transparent;
361
 
  width: 16px;
362
 
  height: 16px;
363
 
  content: "";
364
 
  position: absolute;
365
 
  opacity: 0.2;
366
 
  transition-duration: 0.2s;
367
 
  transition-property: opacity;
368
 
}
369
 

                                    
370
 
#page div.tags a:hover:before {
371
 
  opacity: 1;
372
 
}
373
 

                                    
374
368
#page div.tags span {
375
 
  padding-left: 20px;
 
369
  padding-left: 5px;
376
370
}
377
371

                                        
378
372

                                        
388
382
}
389
383

                                        
390
384
#page div.screenshot-box img {
391
 
  width: 48px;
392
 
  height: 48px;
 
385
  width: 100px;
 
386
  height: 100px;
393
387
  display: block;
394
388
  margin: auto;
395
389
  border-radius: 3px 3px 0 0;
474
468
  text-align: center;
475
469
}
476
470

                                        
 
471
div.user-avatar-default strong {
 
472
  color: {color_900};
 
473
}
477
474

                                        
 
475
div.user-avatar-default img {
 
476
  width: 32px;
 
477
  height: 32px;
 
478
  float: left;
 
479
  padding: 2px 5px 2px 2px;
 
480
  border-radius: 10px;
 
481
}
 
482

                                    
 
483

                                    
478
484
/* FEEDS ATOM/RSS */
479
485
/*#page div.feed, #page a.button, #page div.button {*/
480
486
#page div.feed {
717
723

                                        
718
724

                                        
719
725

                                        
720
 

                                    
721
 

                                    
722
 

                                    
723
 

                                    
724
 

                                    
725
 

                                    
726
 

                                    
727
 

                                    
728
726
/* ??? -- reste de l'ancienne css --  */
729
727

                                        
730
728

                                        
731
729