Jump to content

NAmeviolated

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

NAmeviolated's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey, I have a module that can input custom html/php, and within this I want to put a link ie "Closing soon", that when clicked on displays search results for articles that will hit Finish publishing (publish_down), within 7 days. Now I know I need to create the link, pull the data from publish_down in the sql database, compare it to see if it has less than a certain number of seconds left, and if it does display it when the link is clicked. But have no idea how to go from there code wise. Any ideas on where to start would be appreciated.
  2. Thanks. Worked out that css is doing a lot of the damage. Will repost as you suggested, driving me nuts. CSS code div.catItemExtraFields, div.genericItemExtraFields {margin:16px 0 0 0;padding:8px 0 0 0;border-top:1px dotted #ddd;} div.catItemExtraFields h4, div.genericItemExtraFields h4 {margin:0;padding:0 0 8px 0;line-height:normal !important;} div.catItemExtraFields ul, div.genericItemExtraFields ul {margin:0;padding:0;list-style:none;} div.catItemExtraFields ul li, div.genericItemExtraFields ul li {display:block;} div.catItemExtraFields span.catItemDateCreated {} div.catItemExtraFields ul li span.catItemExtraFieldsLabel, div.genericItemExtraFields ul li span.genericItemExtraFieldsLabel {display:block;float:left;font-weight:bold;margin:0 4px 0 0;width:50%;} div.catItemExtraFields ul li span.catItemExtraFieldsValue {} HTML Code <div class="catItemExtraFields"> <h4>Additional Info</h4> <ul> <li class="even typeDate group1"> <span class="catItemExtraFieldsLabel">Closing date</span> <span class="catItemExtraFieldsValue">Wednesday, 26 October 2011</span> 1 </li> <li class="odd typeSelect group1"> <span class="catItemExtraFieldsLabel">Entry Type</span> <span class="catItemExtraFieldsValue">Upload Pic/Vid</span> 2 </li> </ul> <div class="clr"></div> </div> <div class="clr"></div>
  3. Sorry for all the php tags in this code, but thats the way joomla is coded, so want to keep with the standard. How would I stop a new line happening per item here? I want two items per line. I have changed the css for odd and even to be only 50%, but can't stop the new line. <?php if($this->item->params->get('catItemExtraFields') && count($this->item->extra_fields)): ?> <!-- Item extra fields --> <div class="catItemExtraFields"> <h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4> <ul> <?php foreach ($this->item->extra_fields as $key=>$extraField): ?> <?php if($extraField->value): ?> <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>"> <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span> <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span> </li> <?php endif; ?> <?php endforeach; ?> </ul> <div class="clr"></div> </div> <?php endif; ?>
  4. Thanks, think this is what I'm after as I can't get outside the php brackets
  5. Had some great help yesterday, but I'm stuck using <?php ?> on every line, thanks to Joomla Anyway, I'm trying to create a table, and it doesn't seem to be working, to create it, what is the correct format? <?php <table width='400px' border ='1'>; ?> ?? output will be put out on a per line within a if statement, which works, just the framing of the table and tr and td seem to be eluding me. Thanks
  6. Ok Cool. Thanks heaps for the help . One other weird thing, the span classes aren't correctly formatting the data. Will look at it tomorrow, getting so so sick of Joomla, can't wait to finish this site and go back to Wordpress.
  7. Not sure if thats the right wording for it. I'm using joomla and need to pull a date format from a file $dateInfo = JText::_('date' , $this->item->publish_down); Doesn't work it just shows "Date". But trying to format publish_down via 'date' and store it in $dateInfo Any ideas?
  8. Semi worked it out. The logic for the final If statement to close the final row was causing issues, once I commented it out, it displayed the columns. Trying to check the logic now with a pen and paper
  9. I don't understand it, if I put echo "<span class='catItemExtraFieldsLabel'>{$counter}</span>\n"; above the line with echo "<td class='{$class}'>\n"; the output is 12 but below that line the output is 1 2 Not being that strong in coding I can't see any reason for it.
  10. Think your right here is the css, gathering I take out the list from here div.catItemExtraFields, div.genericItemExtraFields {margin:16px 0 0 0;padding:8px 0 0 0;border-top:1px dotted #ddd;} div.catItemExtraFields h4, div.genericItemExtraFields h4 {margin:0;padding:0 0 8px 0;line-height:normal !important;} div.catItemExtraFields ul, div.genericItemExtraFields ul {margin:0;padding:0;list-style:none;} div.catItemExtraFields ul li, div.genericItemExtraFields ul li {display:block;} div.catItemExtraFields span.catItemDateCreated {} div.catItemExtraFields ul li span.catItemExtraFieldsLabel, div.genericItemExtraFields ul li span.genericItemExtraFieldsLabel {display:block;float:left;font-weight:bold;margin:0 4px 0 0;width:30%;} div.catItemExtraFields ul li span.catItemExtraFieldsValue {}
  11. hmmm, looking at it, it should be working, but still displays it as a list.
  12. Sorry, the code is Joomla/K2 and it's the way they have set it up, I've just been modifying it, to display a table. Thanks for your help, will try it out.
  13. Definately something wrong with the first column, if I do a ($counter%2 != 0) it works for the else statement <?php $table = '<table width="400px" border="0">'; ?> <?php $counter = 0; ?> <?php $total1 = count($this->item->extra_fields); ?> <span class="catItemExtraFieldsLabel"><?php echo $total1 ; ?></span> <?php if($this->item->params->get('catItemExtraFields') && count($this->item->extra_fields)): ?> <!-- Item extra fields --> <div class="catItemExtraFields"> <h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4> <ul> <?php foreach ($this->item->extra_fields as $key=>$extraField) : ?> <?php if ($counter%2 == 0) : ?> <?php if($extraField->value) : ?> <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>"> <?php if ($counter%2 = 0) : ?> <?php '<tr><td width ="200">' ; ?> <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span> <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span> <?php '</td>'; ?> <?php else: ?> // second column <?php '<td width = "200">'; ?> <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span> <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span> <?php '</td></tr>' ; ?> <?php endif ?> <?php $counter++; ?> </li> <?php endif; ?> <?php endif; ?> <?php endforeach; ?> <?php $table .= '</table>'; ?> </ul> <div class="clr"></div> </div> <?php endif; ?>
  14. Everything works, except the construction of the table, thinking I'm missing something in between the following code. <?php if ($counter%2 = 0) : ?> <?php '<tr><td >' ; ?> <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span> <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span> <?php '</td>'; ?> <?php else: ?> // second column <?php '<td >'; ?> <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span> <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span> <?php '</td></tr>' ; ?> <?php endif ?> <?php $counter++; ?>
  15. I can get the first column to display but the second column isn't showing up. <?php $table = '<table width="400px" border="0">'; ?> <?php $counter = 0; ?> <?php $total1 = count($this->item->extra_fields); ?> <span class="catItemExtraFieldsLabel"><?php echo $total1 ; ?></span> <?php if($this->item->params->get('catItemExtraFields') && count($this->item->extra_fields)): ?> <!-- Item extra fields --> <div class="catItemExtraFields"> <h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4> <ul> <?php foreach ($this->item->extra_fields as $key=>$extraField) : ?> <?php if ($counter%2 == 0) : ?> <?php if($extraField->value) : ?> <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>"> <?php if ($counter%2 == 0) : ?> <?php '<tr><td>' ; ?> <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span> <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span> <span class="catItemExtraFieldsLabel"><?php echo $counter ; ?></span> <?php '</td>'; ?> <?php else: ?> // second column <?php '<td>'; ?> <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span> <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span> <span class="catItemExtraFieldsLabel"><?php echo $counter ; ?></span> <?php '</td></tr>' ; ?> <?php endif ?> <?php $counter++; ?> </li> <?php endif; ?> <?php endif; ?> <?php endforeach; ?> <?php $table .= '</table>'; ?> <?php echo $table; ?> </ul> <div class="clr"></div> </div> <?php endif; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.