Datawalke / Coordino

Self-hosted Knowledge Software your question & answer system written on top of the CakePHP Framework
http://coordino.com
MIT License
714 stars 173 forks source link

Answers Vote up/down images #10

Closed gotoitguy closed 11 years ago

gotoitguy commented 13 years ago

I also noticed another issue yesterday that I neglected to mention. The answer's vote up/down images were displaying the html code in the browser, instead of the image itself. Screen cap example: http://www.gotoitguy.com/Coordino_Voteup-down_Bug.png

Problem Code: 161 <?=$html->link( 162 $html->image("arrow_up.png", array("alt" => "Vote Up")), 163 '/vote/' . $answer['Answer']['public_key'] . '/up', 164 null, null, false 165 ); 166 ?> 167 <?=$answer['Answer']['votes'];?> 168 <?=$html->link( 169 $html->image("arrow_down.png", array("alt" => "Vote Down")), 170 '/vote/' . $answer['Answer']['public_key'] . '/down', 171 null, null, false 172 ); 173 ?>

Corrected Code: 161 <?php 162 echo $html->image('arrow_up.png', array('alt' => 'Vote Up', 'url' => '/vote/' . $answer['Answer']['public_key'] . '/up')); 163 ?> 164 <?=$answer['Answer']['votes'];?> 165 <?php 166 echo $html->image('arrow_down.png', array('alt' => 'Vote Up', 'url' => '/vote/' . $answer['Answer']['public_key'] . '/down')); 167 ?>

Hope this type of stuff is beneficial to your project. If you'd like me to push the info elsewhere, let me know. Also, I'm brand new to Github, so I don't know if there's another way I can present the code to you?

ghost commented 13 years ago

I am having the same issue as gotoitguy.

gotoitguy commented 13 years ago

Nasium,

I just realized I hadn't included the location of the problem code, it's located at: app/views/posts/view.ctp

Simply locate the problem code, and replace it with the corrected code.

Hope this helps.

Thanks.

ghost commented 13 years ago

Are we able to commit a change to the code in the project?

Datawalke commented 11 years ago

Fixed in the next branch. Thank you @gotoitguy !