Joined: Nov 19, 2007 Posts: 177 Location: Netherlands
Posted:
Thu May 01, 2008 1:21 pm
Ey guys,
Thought i'd might drop by again
I used the search for this one and did found some things but not exactly what i was looking for.
Here's my question;
I always wondered why you couldnt just click on the newstitle of an article posted on the homepage (index), just like most websites/blogs out there work.
You can only click on the 'Comments' or 'Read More' link at the bottom of the article (headline), at least in php-nuke 7.9 which im running.
I already made some changes in my theme.php, cause i couldnt find any article title in the modules/News/index.php.
To the themeindex() function. The link above was copied from modules/News/index.php at the 'Read More' function.
Problem is that it needs that $s_sid, and im not exactly sure how to include it?
Looks like i need to pull this from the db with one of those sql functions but my knowledge on that is just very limited.
So how can I make this work? Other (easier) solutions are welcome as well of course
Edit: This is the 1st part of the sql query found in modules/News/index.php
Code:
$result = $db->sql_query("SELECT sid, catid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, acomm, score, ratings FROM ".$prefix."_stories $qdb $querylang ORDER BY sid DESC limit $storynum");
while ($row = $db->sql_fetchrow($result)) {
$s_sid = intval($row['sid']);
warren-the-ape - In an ideal world, you want to separate data from visual layout so with that in mind, it would IMHO be better to modify News/index.php rather than the theme.
The topic title is held in the var $title within index.php which you can see if you look at the code you posted above in the 'while' loop.
If you look at my site as an example, I have included text as well as the topic title in the ALT and TITLE html tags (I'm actually using images not text links).
Joined: Nov 19, 2007 Posts: 177 Location: Netherlands
Posted:
Sun May 11, 2008 6:40 am
Sorry for the late response, posted this topic just before i went on vacation
But many thanks for the help and replies, it seems I was pretty close, looking at your code kguske What you have on nukeseo.com is exactly what I had in mind, great stuff.
@ Guardian2003
Yep yep I know , but my php knowledge is still very limited + im only using 1 theme on my site so dont think it would be a big problem.
Btw, i dont want to remove the 'readmore' and 'comments' links, just want to make a link out of the article title as well, mostly out of SEO purposes and cause its easier the click.
@ kguske
Could you explain the dots '.' around those variables (f.e. '.$sid.')? Is that necessary in PHP or just to make it php compliant? Me = still learning
Joined: Nov 19, 2007 Posts: 177 Location: Netherlands
Posted:
Sun May 11, 2008 6:54 am
Hmm, it doesn't seem to work as it should be.
Im still getting the following link for all my articles;
Only registered users can see links on this board! Get registered or login to the forums!
So its still missing that 'sid' nmbr.
This is the entire function, there was already a 'global' so i placed the '$sid' there, not sure if thats correct?
Code:
/************************************************************/
/* Function themeindex() */
/* */
/* This function format the stories on the Homepage */
/************************************************************/
OK, so I downloaded 7.9 and verified that the variable you need to use is $s_sid instead of $sid. Replace that in the global statement and in the link in this function, and it should work correctly.
It's strange - the link still has sid = $s_sid... So don't change your link - just the variable ($sid -> $s_sid).
ALSO, in function theindex in modules/News/index.php, add $s_sid to the global variable declaration statement.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum