1 kskhater Feb 03, 2007 06:27
3 kskhater Feb 04, 2007 04:13
Well, it does not work for me. If you visit my site @
http://www.alkhater.net/link_stub.php
and if you click on the post title, it will take you to the full entry, even though I have inserted:
Link to URL = http://www.maavak.net/
Maybe I'm doing something wrong in skin/_main.php
Here is the code for the post:
<?php // ------------------------------------ START OF POSTS ----------------------------------------
if( isset($MainList) ) $MainList->display_if_empty(); // Display message if no post
if( isset($MainList) ) while( $Item = & $MainList->get_item() )
{
locale_temp_switch( $Item->locale ); // Temporarily switch to post locale
?>
<?php
if (!( $blog == 18 OR $blog == 20 OR $disp == 'single' )) { ?>
<div class="bTitle"><h3 class="bTitle"><a href="<?php $Item->permanent_url() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', FALSE ); ?></a></h3></div>
<? } else { ?>
<!-- <div class="bTitle"><h3 class="bTitle"><?php $Item->title(); ?></h3></div> -->
<? } ?>
<div class="bPost" lang="<?php $Item->lang() ?>">
<?php
$Item->anchor(); // Anchor for permalinks to refer to
?>
<div class="bMediumHead">
<?php
// $Item->permanent_link( '#icon#' );
echo ' ';
// $MainList->date_if_changed();
if (!( $blog == 17 OR $blog == 18 OR $blog == 20)) {
$Item->issue_date();
echo ' @ ';
$Item->issue_time();
echo ', ', T_('Categories'), ': ';
$Item->categories();
echo ' ';
}
?>
</div>
<div class="bText">
<?php $Item->content(); ?>
<?php link_pages() ?>
</div>
<!-- stopprint -->
<?php if ( $blog == 2 ) { ?>
<div class="bSmallPrint">
<?php $Plugins->call_by_code( 'starrating', array('id' => $Item->ID ) ); ?>
<!-- <?php $Item->permanent_link(); ?> -->
<?php $Item->feedback_link( 'comments', '' , '', 'Leave a comment', 'Leave a comment', 'Leave a comment') // Link to comments ?>
<!-- <?php $Item->feedback_link( 'comments', ' • ' ) // Link to comments ?> -->
<?php $Item->feedback_link( 'trackbacks', ' • ' ) // Link to trackbacks ?>
<?php $Item->feedback_link( 'pingbacks', ' • ' ) // Link to trackbacks ?>
<?php $Item->edit_link( ' • ' ) // Link to backoffice for editing ?>
<?php $Item->trackback_rdf() // trackback autodiscovery information ?>
•
<a href = "http://www.alkhater.net/blog/addOns/friend/friend.php?id= <?php $Item -> permanent_url() ?>" title = " Send "<?php $ttl = $Item -> title; $ttl = str_replace('"', '', $ttl); $ttl=strip_tags($ttl); echo $ttl; ?>" to a Friend " onclick = "javascript:popUp ( 'http://www.alkhater.net/blog/addOns/friend/friend.php?id=<?php $Item -> permanent_url() ?>&js=on&p=<?php echo $Item->ID ?>' ); return false" ><img src="http://alkhater.net/blog/img/icon_mail.gif" alt="<?php echo T_('mail') ?>"/> Email link to a friend</a>
<?
echo '• <a href="http://www.alkhater.net/blog/addOns/phprint/phprint.php"><img src="http://alkhater.net/blog/img/icon_print.gif" alt="';
echo T_('Print');
echo '"/> Print this article</a>';
?>
</div>
<?}
elseif ($blog == 17) {
$Item->feedback_link( 'comments', '' , '', 'Leave a comment', 'Leave a comment', 'Leave a comment'); // Link to comments
$Item->edit_link( ' • ' ); // Link to backoffice for editing
}
else {
?>
<div class="bSmallPrint">
<?PHP
if( $disp != 'single') {
if (!( $blog == 10 OR $blog == 18 OR $blog == 20)) { ?>
<a href="<?php $Item->permanent_url() ?>" title="<?php echo T_('Permanent link to full entry') ?>" class="permalink_right"><img src="img/chain_link.gif" alt="<?php echo T_('Permalink') ?>" width="14" height="14" border="0" class="middle" /></a>
<? } } ?>
<?php $Plugins->call_by_code( 'starrating', array('id' => $Item->ID ) ); ?>
<?php if( $disp == 'single' ) $Item->feedback_link( 'comments', ' • ' ) // Link to comments ?>
<?php $Item->feedback_link( 'trackbacks', ' • ' ) // Link to trackbacks ?>
<?php $Item->feedback_link( 'pingbacks', ' • ' ) // Link to trackbacks ?>
<?php $Item->edit_link( ' • ' ) // Link to backoffice for editing ?>
<?php $Item->trackback_rdf() // trackback autodiscovery information ?>
•
<?php if (!( $blog == 18 OR $blog == 20)) { ?>
<a href = "http://www.alkhater.net/blog/addOns/friend/friend.php?id= <?php $Item -> permanent_url() ?>" title = " Send "<?php $ttl = $Item -> title; $ttl = str_replace('"', '', $ttl); $ttl=strip_tags($ttl); echo $ttl; ?>" to a Friend " onclick = "javascript:popUp ( 'http://www.alkhater.net/blog/addOns/friend/friend.php?id=<?php $Item -> permanent_url() ?>&js=on&p=<?php echo $Item->ID ?>' ); return false" ><img src="http://alkhater.net/blog/img/icon_mail.gif" alt="<?php echo T_('mail') ?>"/> Email link to a friend</a>
<?} ?>
<?php if( $disp == 'single') {
if (!( $blog == 18 OR $blog == 20 )) {
echo '• <a href="http://www.alkhater.net/blog/addOns/phprint/phprint.php"><img src="http://alkhater.net/blog/img/icon_print.gif" alt="';
echo T_('Print');
echo '"/> Print this article</a>';
}
}
if( $disp != 'single') {
if ( $blog == 6 OR $blog == 8) {
echo '• Follow this link to print --->';
}} ?>
</div>
<? } ?>
<?php // ------------- START OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. -------------
$disp_comments = 1; // Display the comments if requested
$disp_comment_form = 1; // Display the comments form if comments requested
$disp_trackbacks = 1; // Display the trackbacks if requested
$disp_trackback_url = 1; // Display the trackbal URL if trackbacks requested
$disp_pingbacks = 0; // Display the pingbacks if requested
require( dirname(__FILE__).'/_feedback.php' );
if( $disp == 'single') $Item->feedback_link( 'comments' ); // Link to comments
locale_restore_previous(); // Restore previous locale (Blog locale)
// ---------------- END OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. ----------------
?>
</div>
<?php } // ---------------------------------- END OF POSTS ------------------------------------ ?>
$blog 10 is the Linkblog. I hope you don't mind having a look.
4 personman Feb 04, 2007 04:22
Change this:
<a href="<?php $Item->permanent_url() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', FALSE ); ?></a>
to this:
<?php $Item->title(); ?>
And it will stop being a permalink and start working like you want.
5 kskhater Feb 04, 2007 04:41
Thanks, it works now in the full entry but not the post summary (not the full entry,) the link takes you to the full entry. I only need ==> Read more! to do that.
6 stk Feb 04, 2007 04:43
Yes, it is the skin file. You are ALWAYS forcing the link to be [ $Item->permanent_url() ] with the code:
<h3 class="bTitle"><a href="<?php $Item->permanent_url() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', FALSE ); ?></a></h3>
In mine, I have as Danny suggested:
<h3 class="bTitle"><?php $Item->title(); ?></h3>
Not sure how it got there, but the good news is that it's a simple fix. :D
7 kskhater Feb 04, 2007 05:17
This exactly what I did as the code below shows:
if (!( $blog == 18 OR $blog == 20 OR $disp == 'single' )) { ?>
<div class="bTitle"><h3 class="bTitle"><a href="<?php $Item->permanent_url() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', FALSE ); ?></a></h3></div>
<? } elseif ( $blog == 10) { ?>
<div class="bTitle"><h3 class="bTitle"><?php $Item->title(); ?></h3></div>
<? } ?>
but that works only in $disp == 'single'
Remember $blog 10 is my linkblog.
8 edb Feb 04, 2007 05:39
So let's analyze this a bit and see where the problem lies. Let's pretend we're on blog #10 and replace the this==that sections with true or false:
if (! ( false OR false OR false ) ) { ?>
<div class="bTitle"><h3 class="bTitle"><a href="<?php $Item->permanent_url() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', FALSE ); ?></a></h3></div>
<? } elseif ( true ) { ?>
<div class="bTitle"><h3 class="bTitle"><?php $Item->title(); ?></h3></div>
<? } ?>
Now take it one step further and note that the first IF statement will almost always equate to true.
if (! ( false OR false OR false ) ) { ?>
This is the same, for all practical intent, as:
if (! ( false ) ) { ?>
The ! means to inverse the results, meaning that line becomes:
if ( true ) { ?>
So it now makes sense that every post on every blog in any circumstances will result in the title being the permalink. You will never get to the elseif component of your code because you can never reach a point where the first part equates to "false". To do that you would need to be on blog #18 AND blog #20 AND a single post page. That's very hard to do!
What exactly is your goal? Do you want the title to be a permalink all the time EXCEPT in your linkblog? If so that is very easily done my friend. Do you only want the title to be the permalink on those two blogs or when on a single post page? If so that too can be done, but why you would want a link to the page the person is on confuses me. Let me know what you want and I'll show you how to code it. If I can!
9 edb Feb 04, 2007 05:44
Wait a minute I'm missing a bit there. Given that blog #10 in multipage mode will show the first part, but being all you need is one "true" of your first three conditionals to have the whole thing equal false.
Therefore clicking on any post's permalink (currently the title) means the first line becomes "if( ! ( false or false or true ) )" which ends up finally being "false" because the single true will invert to a false.
Anyway what is it you're after and we'll make it happen.
10 kskhater Feb 04, 2007 05:48
Thanks EdB,
What I want is for the title to be a permalink all the time EXCEPT in my linkblog? Both in post summary and full entry. I want to access the full entry only through =>Readmore!
11 edb Feb 04, 2007 06:05
Well that seems easy enough, except I am confused by one thing. I'll get to that in a moment. First let's try this code:
if ( $blog != 10 ) { ?>
<div class="bTitle"><h3 class="bTitle"><a href="<?php $Item->permanent_url() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', FALSE ); ?></a></h3></div>
<? } else { ?>
<div class="bTitle"><h3 class="bTitle"><?php $Item->title(); ?></h3></div>
<? } ?>
That will mean the every time forever and ever under all circumstance EXCEPT blog #10 you will have your title as your permalink. Be it a multipost page or a single post page, blog #1 or blog #99 - as long as it's not blog #10.
The thing that confuses me is when you say "I want to access the full entry only through =>Readmore!" because you can have a readmore on something that is not blog #10. Did you mean you want full access to linkblog posts only through the readmore link? If so the code above will do as you desire.
By the way that's an interesting use of the linkblog feature. Rather than adding a list of links to the sidebar (which is what it really wants to do of course) you have a blog that is the blog you share links in. With this method you get to post *why* you think people would find that link valuable.
12 kskhater Feb 04, 2007 06:20
Thanks EdB, this is exactly what I wanted but my old code eliminated the double entry title for all the blogs in a single post view.
It seems have to titles, one plain and the other is $Item->permanent_url() not elegant.
13 edb Feb 04, 2007 07:24
That's coming from something else in your _main.php file because it's an H2 tag - not the H3 tag this bit of code worked up for you. You probably have something like this:
<?php
// ------------------------- TITLE FOR THE CURRENT REQUEST -------------------------
request_title( '<h2>', '</h2>' );
// ------------------------------ END OF REQUEST TITLE -----------------------------
?>
Change it to something like this and the second will go away:
<?php
// ------------------------- TITLE FOR THE CURRENT REQUEST -------------------------
if( $disp != 'single' ) {
request_title( '<h2>', '</h2>' );
}
// ------------------------------ END OF REQUEST TITLE -----------------------------
?>
14 kskhater Feb 04, 2007 07:54
Thanks EdB,
This works just fine.
I'm not 100% certain that I understand your question.
However, I have just tested the 1.9.2 "link to url" for the "title of a post" in the Write pane.
Test data:
Post Title= "Test"
Link to URL = (originally BLANK, but I changed it to "http://randsco.com")
Worked fine. :D