Gå til innhold

AJFORK endre litt i "prev-next-article-links.php"


Anbefalte innlegg

Jeg bruker AJFORK på siden min for å legge til nyheter. Men jeg har et lite problem. Jeg får ikke til å få linken nederst hvor man kan bla frem og tilbake i nyhetene til å få samme link farge som det andre på siden.

 

Så hvis noen vet hvordan jeg skal legge in class for å få stylet linkene slik jeg vil ha de hadde det vært til stor hjelp. Sjekk www knappen for å se siden min.

 

Her er den css'en jeg vil at linkene skal bruke:

.link {
color: #FF6600;
}

 

Her er php koden som styrer de linkene.

<?php

/*
Plugin Name: Prev and Next Link Text In Full Story
Plugin URI: http://www.jubbag.com
Description: Adds a link with the next and previous news stories with their title as the Link Text. Use {prevlink} and {nextlink}. Comes with formatting: << Previous | and | Next >>. Feel free to edit it in the code of the plugin. Based on code from <a href="http://cutephp.com/forum-old/index.php?showtopic=3690&hl=prev%20next&st=0">CuteNews Forum</a> by <a href="http://www.cncreneclips.com">Stealtheye</a>
Version: 0.7
Author:	J-Dawg
Author URI:	http://www.jubbag.com
Application: CuteNews
Required Framework: 1.0.0
*/
define('STAY_IN_CATEGORIES', 'true');
@add_filter('cutenews-options', 'PN_AddToOptions');
@add_action('plugin-options','PN_CheckAdminOptions');
@add_filter('news-show-generic','prev_next');


function prev_next($output,$hook)
{

global $all_active_news, $active_news, $news_arr, $category, $ucat, $aj_plugins, $archive;
$PN = new PluginSettings('Previous-Next');
$catrestrict = $PN->settings['prevnext'];
if (empty($catrestrict)) $catrestrict = STAY_IN_CATEGORIES;
$prevnum = 1;
$nextnum = 1;
$thisnews = explode("|", $active_news);
$thiscat = $thisnews[6];
$all_active_news = array_reverse($all_active_news);
$index = array_search($active_news, $all_active_news);
if ($catrestrict == 'true')
{
 do 
 {
 	$prev = explode("|", $all_active_news[$index - $prevnum]);
 	if (empty($prev[6]))
 	{
   break;
 	}
 	$prevnum ++;
 }
 while ($thiscat != $prev[6]);
 do
 {
 	$next = explode("|", $all_active_news[$index + $nextnum]);
 	if (empty($next[6]))
 	{
   break;
 	}
 	$nextnum ++;
 }
 while ($thiscat != $next[6]);
}
else
{
 $next = explode("|", $all_active_news[$index + 1]);
 $prev = explode("|", $all_active_news[$index - 1]);
}

# humanfriendly stuff
if (!$ucat && $category) { $ucat = $category; }

$nid = aj_prepareTitle($next[2]);
if($nid == "") { $nid = $next[0]; }
$pid = aj_prepareTitle($prev[2]);
if($pid == "") { $pid = $prev[0]; }

// Friendly urls w/ archive recognition
if (isset($GLOBALS['aj_plugins']['friendlyurls'])) { 
$kat = aj_getCat($ucat);
if (!$archive) {
 $next_link = "<a href=\"".date("Y/m/d/", $next[0])."$kat/$nid.html\">$next[2]</a>";
 $prev_link = "<a href=\"".date("Y/m/d/", $prev[0])."$kat/$pid.html\">$prev[2]</a>";
 }
else {
   $furls = new PluginSettings('Userfriendly_URLs');
   $linkdata = $furls->settings['text']['0'];

 $next_link = "<a href=\"$linkdata[AR]/$archive/".date("Y/m/d/", $next[0])."$kat/$nid.html\">$next[2]</a>";
 $prev_link = "<a href=\"$linkdata[AR]/$archive/".date("Y/m/d/", $prev[0])."$kat/$pid.html\">$prev[2]</a>";
 }
}
else {
$next_link = "<a href='$PHP_SELF?aj_go=more&id=$next[0]&archive=$archive&start_from=$start_from&ucat=$ucat&$user_query'>$next[2]</a>";
$prev_link = "<a href='$PHP_SELF?aj_go=more&id=$prev[0]&archive=$archive&start_from=$start_from&ucat=$ucat&$user_query'>$prev[2]</a>";
}
if (!empty($next[0]))
{
 $output = str_replace("{nextlink}", $next_link, $output);
}
else
{
 $output = str_replace("{nextlink}", "", $output);
}
if (!empty($prev[0]))
{
 $output = str_replace("{prevlink}", $prev_link, $output);
}
else
{
 $output = str_replace("{prevlink}", "", $output);
}
return $output;

}

function PN_CheckAdminOptions($hook) {
// check if the user is requesting the PN options
 if ($_GET['action'] == 'PN')
 	// show the PN admin screen
 PN_AdminOptions($hook);
}

function PN_AdminOptions($hook) {

// Load the plugin settings
$PN = new PluginSettings('Previous-Next');

if (!empty($_GET['PN'])) {
 $PN->settings['prevnext'] = $_GET['PN'];
 $PN->save();
 msg('info','Previous Next Settings Saved', 'Your settings were saved successfully', '?mod=options&action=PN');
}

// Display header
echoheader('user','Previous Next Configuration');

$catrestrict = $PN->settings['prevnext'];

if (empty($catrestrict))
{
 $catrestrict = STAY_IN_CATEGORIES;
}
if ($catrestrict == 'true')
{
 $text = "Staying In Category<br />";
 $link = "false";
 $linktext = "Check all categories";
}
else
{
 $text = "Checking all categories<br />";
 $link = "true";
 $linktext = "Stay In Category";
}
$buffer = $text.'<br /><a href="?mod=options&action=PN&subaction=save&PN='.$link.'">'.$linktext.'</a>';	
echo $buffer;	

// Display footer
echofooter();
}

function PN_AddToOptions($options, $hook) {
global $PHP_SELF;

// Add a custom screen to the "options" screen
$options[] = array(
 'name'  => 'Previous Next Options',
 'url'  => $PHP_SELF.'?mod=options&action=PN',
 'access'	=> '1',
);

// return the customized options
return $options;
}
?>

Lenke til kommentar
Videoannonse
Annonse

Fikk løst problemet ved å gi den diven som inholdet er i en fargekode for alle linker i den:

 

div#text a {
color: #FF6600;
}

 

Takk for hjelpen Loomy. Du kan jo alt du. Men det med kontrollpanelet slo feil så jeg er glad du kom med denne løsningen istedet :thumbup:

Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
×
×
  • Opprett ny...