Welcome Guest, Not a member yet? Register   Sign In
anchor() generates wrong links?
#21

[eluser]TheFuzzy0ne[/eluser]
I see no echo statements:
Code:
<ul id="newsPosts">    
    &lt;?php if ($verify['available'] === TRUE) : ?&gt;
        &lt;?php foreach($news as $row): ?&gt;
            &lt;ul>
                &lt;li><h1>&lt;?php echo $row['title']; ?&gt;</h1></li>
                &lt;li><h2>Posted by &lt;?php echo $row['user']; ?&gt; on &lt;?php echo $row['date']; ?&gt;</h2></li>
            &lt;?php if($row['image'] != ""): ?&gt;
                &lt;li class="post_body"><img src="&lt;?php echo $row['image']; ?&gt;">&lt;?php echo $row['text'] . anchor($row['archive'], '(read more)'); ?&gt;</li>
            &lt;?php else: ?&gt;
                &lt;li class="post_body">&lt;?php echo $row['text'] . anchor($row['archive'], '(read more)'); ?&gt;&lt;/li>
            &lt;?php endif; ?&gt;
            &lt;/ul>
        &lt;?php endforeach; ?&gt;
    &lt;?php else: ?&gt;
          &lt;?php echo $verify['message']; ?&gt;
    &lt;?php endif; ?&gt;
</ul>
The above code is untested, but should hopefully get you back on the right track.

I've compacted it a bit, and (in theory) made it easier to follow by using the alternative construct syntax, and I got rid of the short tags (even though you're free to replace them). I also noticed that you had an extra opening &lt;ul> in there, and so I removed it.
#22

[eluser]mindesign[/eluser]
Thanks I will put this all in when I get home to see if it works. the "extra" <ul> wasn't extra, I have an unordered list of unordered lists Smile

thanks again for the help. I'll let you know how it goes.
#23

[eluser]TheFuzzy0ne[/eluser]
You're right. I do apologise, I missed that last &lt;/ul>
#24

[eluser]mindesign[/eluser]
huh. would you look at that. it worked. thanks a ton. I didn't know you have to echo those statements
#25

[eluser]TheFuzzy0ne[/eluser]
Glad you got it sorted. Smile
#26

[eluser]brianw1975[/eluser]
[quote author="brianw1975" date="1235122675"]hrm... did you try site_url in place of anchor?


Quote:site_url()

....

echo site_url("news/local/123");

The above example would return something like: http://example.com/index.php/news/local/123

Here is an example of segments passed as an array:
$segments = array('news', 'local', '123');

echo site_url($segments);
[/quote]


the sound you hear in the distance is me weeping

;-)
#27

[eluser]mindesign[/eluser]
Quote:the sound you hear in the distance is me weeping

wink

hahaha I was blind but now I see. lol thanks for the help




Theme © iAndrew 2016 - Forum software by © MyBB