Welcome to Geeklog, Anonymous Thursday, October 03 2024 @ 07:03 pm EDT
Geeklog Forums
Search results without the time
Status: offline
Imaginate
Forum User
Chatty
Registered: 12/03/03
Posts: 41
This is the code that outputs the DATE & TIME with the search results: does anyone know how to remove the actual time from the date in its place put the year?
or at least just remove the time from the story?
// get rows
$A['title'] = str_replace ('$', '$', $A['title']);
$thetime = COM_getUserDateTimeFormat ($A['day']);
if (empty ($urlQuery)) {
$articleUrl = COM_buildUrl ($_CONF['site_url']
. '/article.php?story=' . $A['sid']);
} else {
$articleUrl = $_CONF['site_url'] . '/article.php?story='
. $A['sid'] . '&query=' . urlencode ($urlQuery);
}
$author = $this->_displayName ($A['username'], $A['fullname']);
if ($A['uid'] == 1) {
$profile = $author;
} else {
$profile = '<a href="' . $_CONF['site_url']
. '/users.php?mode=profile&uid=' . $A['uid']
. '">' . $author . '</a>';
}
$row = array ('<a href="' . $articleUrl . '">'
. stripslashes ($A['title']) . '</a>',
$thetime[0]);
or at least just remove the time from the story?
// get rows
$A['title'] = str_replace ('$', '$', $A['title']);
$thetime = COM_getUserDateTimeFormat ($A['day']);
if (empty ($urlQuery)) {
$articleUrl = COM_buildUrl ($_CONF['site_url']
. '/article.php?story=' . $A['sid']);
} else {
$articleUrl = $_CONF['site_url'] . '/article.php?story='
. $A['sid'] . '&query=' . urlencode ($urlQuery);
}
$author = $this->_displayName ($A['username'], $A['fullname']);
if ($A['uid'] == 1) {
$profile = $author;
} else {
$profile = '<a href="' . $_CONF['site_url']
. '/users.php?mode=profile&uid=' . $A['uid']
. '">' . $author . '</a>';
}
$row = array ('<a href="' . $articleUrl . '">'
. stripslashes ($A['title']) . '</a>',
$thetime[0]);
12
10
Quote
Status: Banned
machinari
Forum User
Full Member
Registered: 03/22/04
Posts: 1512
if you're keen on modifying the core then to start you can modify (config.php):
$_CONF['dateonly'] = '%d-%b';
Change the previous to the following In order to reflect the year as well as just the day and month (which I think a date should do anyway) like so (config.php):
Then change the code you quoted above to reflect the following (search.class.php):
$thetime[0] = strftime( $_CONF['dateonly'], $A['day'] );
You can always just define your own custom date format and create a new space for it in the config.php file like $_CONF['mypreferreddateformat'] and then use that in the above snippet.
Or you could add your preferred date format to the database and just select it as default in your site's settings. That would make it a site wide change, but you wouldn't have to modify the core.
I can go on if you like, but that should get you going.
Text Formatted Code
$_CONF['dateonly'] = '%d-%b';
Text Formatted Code
$_CONF['dateonly'] = '%d-%b-%Y';Then change the code you quoted above to reflect the following (search.class.php):
Text Formatted Code
//$thetime = COM_getUserDateTimeFormat ($A['day']);$thetime[0] = strftime( $_CONF['dateonly'], $A['day'] );
You can always just define your own custom date format and create a new space for it in the config.php file like $_CONF['mypreferreddateformat'] and then use that in the above snippet.
Or you could add your preferred date format to the database and just select it as default in your site's settings. That would make it a site wide change, but you wouldn't have to modify the core.
I can go on if you like, but that should get you going.
14
11
Quote
All times are EDT. The time is now 07:03 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content