[Fixed] Problem displaying a FC universal module [v1.5.5]

More
12 years 10 months ago - 12 years 10 months ago #22247 by rbodinmultimedia
Hello

I am trying to create a module, to display a random article from a specific type in a sepecific category, with extra fields I specified...

But the result in front display this :

* @modifed Richard Sumilang * @param string $datetime TimeStamp of the time you woud like to edit "YYYY-MM-DD HH:MM:SS". * @param integer $shit_amount The amount you want to shit * @param string $shift_unit Unit you would like to shift * @return timestamp */ function shift_dates($datetime="", $shift_amount, $shift_unit) { /* Check for $datetime */ if(!$datetime){ $datetime=date("Y-m-d H:i:s"); } /* Split into separate sections: date and time */ list($date, $time)=split(" ", $datetime); /* Break down the date */ list($year, $month, $day)=split("-", $date, 3); /* Break down the time */ list($hour, $min, $sec)=split(":", $time, 3); /* This is the date shifting area */ if($shift_unit=="m") { $newdate = mktime ($hour,$min,$sec,$month+$shift_amount,$day, $year); $newdate = date("Y-m-d H:i:s", $newdate); } elseif( $shift_unit=="d") { $newdate = mktime ($hour,$min,$sec,$month,$day+$shift_amount, $year); $newdate = date("Y-m-d H:i:s", $newdate); } elseif ($shift_unit=="Y") { $newdate = mktime ($hour,$min,$sec,$month,$day, $year+$shift_amount); $newdate = date("Y-m-d H:i:s", $newdate); } elseif( $shift_unit=="H") { $newdate = mktime ($hour+$shift_amount,$min,$sec,$month,$day, $year); $newdate = date("Y-m-d H:i:s", $newdate); } elseif ($shift_unit=="i") { $newdate = mktime ($hour,$min+$shift_amount,$sec,$month,$day, $year); $newdate = date("Y-m-d H:i:s", $newdate); } elseif( $shift_unit=="s") { $newdate = mktime ($hour,$min,$sec+$shift_amount,$month,$day, $year); $newdate = date("Y-m-d H:i:s", $newdate); } return $newdate; } /** * This converts MM-DD-YYYY to YYYY-MM-DD * * @author Richard Sumilang * @param date $date MM-DD-YYYY * @return string */ function machine_date($date){ list($month, $date, $year)=split("-", $date); return $year . "-" . $month . "-" . $date; } /** * This converts YYYY-MM-DD to MM-DD-YYYY * * @author Richard Sumilang * @param date $date YYYY-MM-DD * @return string */ function human_date($date){ list($year, $month, $date)=split("-", $date); return $month . "-" . $date . "-" . $year; } /** * This converts stuff like 3:00am to 03:00 and 4:00pm to like 16:00 * * @author Richard Sumilang * @param string $time Time in the form of 1:00 or whatever * @param string $ampm Values are am or pm * @return string */ function convert_to_24_hr($time, $ampm){ /* Make sure it's lower case */ $ampm=strtolower($ampm); /* Split the time */ list($hour, $min)=split(":", $time); switch($ampm){ case "am": $hour=$this->fill_time($hour); break; case "pm": $hour=$hour + 12; break; } $min=$this->fill_time($min); return $hour . ":" . $min; } /** * This converts stuff like 16:00 to 04:00pm * * @author Richard Sumilang * @param string $time Time in the form of HH:MI * @return array */ function convert_from_24_hr($time){ /* Split up the time */ list($hour, $min)=split(":", $time); if($hour > 12){ $hour=$hour-12; $ampm="pm"; }else{ $ampm="am"; } if($hour=="00"){ $hour="24"; } $result=array( "time" => $hour . ":" . $min, "ampm" => $ampm ); return $result; } /** * Add a 0 in front of times with 1 character * * @author Richard Sumilang * @param string $string * @return string */ function fill_time($string){ if(strlen($string)==1){ $string="0" . $string; } return $string; } } ?>

I searched in module files, and it came with the classes/datetime.php

But what can I do from here to solve my problem ?

Thank you very much in advance.

Best Regards

rbodin
Last edit: 12 years 10 months ago by rbodinmultimedia.

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #22250 by micker
whitch version of flexicontent ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #22268 by ggppdk
It looks like you are getting display of a php file, this is not supposed to happen, your web server should execute it, has the php file being altered or corrupted,
maybe reinstall flexicontent,
as micker asked what version of FLEXIcontent you have?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #22280 by rbodinmultimedia
This is the 1.5.5 now...
I think this more related to the module than the Flexicontent itself... as I don't have any problem like this anywhere else.

But that's OK... I don't have this pb anymore. The opening tag was : "<?". my server prefers "<?php".

On the other hand the php files in this folder don't have closing tags... I'm not an expert but it seems really strange... is it normal ?
for example :
mod_flexicontent/mod_flexicontent.php's last line is :
Code:
require(JModuleHelper::getLayoutPath('mod_flexicontent', $layout));
there is no "?>".

The same goes for every other php file in the module folder (except the tpl files and the classe file mentionned earlier.

Well now, I don't have an error, but my box is empty. I guess I need to figure out how to configure it properly :)

Thank you all for your help :)

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #22286 by ggppdk
Please try with v1.5.6 preRC1110
code.google.com/p/flexicontent/downloads/list
and also apply this fix:

www.flexicontent.org/forum/index ... 120#p22216


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #22289 by rbodinmultimedia
Well.. I wish I could... but the server it having too much permission issues to install new versions... the network admin of my company don't want to make some changes... :evil:

Is it mandatory ? can't the module work without it ?

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.415 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline