Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function trails_init() {
- // Grab the trail history from a variable
- $trail = variable_get('trails_history', array());
- // Add current page to test array
- $testarray = array(
- 'title' => strip_tags(drupal_get_title()),
- 'path' => $_GET['q'],
- 'timestamp' => REQUEST_TIME,
- );
- $new_trails = $trail;
- //If the current trail array has a matching title with the test array, then just set time.
- foreach ($trail as $trailvalue){
- //check the titles
- if ($trailvalue['title'] == $testarray['title']){
- $trailvalue['timestamp'] = REQUEST_TIME;
- }
- //else add the $testarray array to the next
- else {
- $new_trails[] = $testarray;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement