|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
///////////////////////////////////////////////////////////////////////////////// e: c1 R( W: {/ H
// Theme Option) n u9 s1 a# K; W2 E
////////////////////////////////////////////////////////////////////////////////8 x8 C! ^% V3 E/ D+ x
+ G% f% }6 r$ x
$themename = "Zenx";
" N5 w% p, T4 ~; M7 S+ H4 ~$shortname = str_replace(' ', '_', strtolower($themename));
/ q! X3 a. X. {3 B9 N/ b% ~
) @2 d3 t9 e7 p8 ~function get_theme_option($option)% L! p2 X4 |: o0 a) f
{8 I+ C+ m, L- H9 z
global $shortname;
9 D% s/ H0 W6 I, t2 \$ {3 p return stripslashes(get_option($shortname . '_' . $option));, a6 F! e% e% F6 v
}
- x2 g' p$ L/ G& I, g- t& r% Y$ o0 D, {0 \$ |
function get_theme_settings($option): Y6 F/ X+ Y! o2 ~
{6 Z% s/ B; X# R, w3 i2 m5 k
return stripslashes(get_option($option));" u& P& k/ P" g( @( Y: Y& Y# B0 Z
}
! v/ X' T' b+ ?: ^$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
! z& j. S! v/ |$wp_getcat = array();
7 O. V" b a1 v: v5 Fforeach ($wp_dropdown_rd_admin as $category_list) {
# J; H0 K4 p( f2 F9 @$wp_getcat[$category_list->term_id] = $category_list->name;
_$ W6 w2 O, r* V6 i8 `}* \7 Z4 a9 Z% h+ r% `$ E. V
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
3 o2 d" \4 b5 b; v$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
# G$ Z3 U$ q3 h. Q' T$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");0 c. q. f# ], i( g( g3 B/ C* t% \
; |, {: J* p; s# A$options = array (0 C/ M/ \9 o7 T! H. |: Q
3 o! H- l+ j3 E% Y4 y, {# \2 ?. R* |
array( "name" => "Blog Header Settings",% A; ]: _* k8 g( b
"type" => "heading",: N6 f2 J' Z4 T
),. B0 g" f! x' ]& m _' `
# n9 H; c6 y. K) j
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
/ {6 L& c# J5 {* ^' G "id" => $shortname."_header_logo_activate",
' q; E% a' g0 l7 Y$ ?0 Z+ B! X1 a6 s "type" => "select",
: l9 W" U1 h) N "std" => "No",; p* T7 g: D9 p& V) L6 y
"options" => array("No", "Yes")),
7 _# u, C2 V+ ?8 u1 r
. W1 x! Y- D7 K. |' W+ E array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",9 T% H, j* P0 W6 P4 m3 n4 t
"id" => $shortname."_logo_url",& s% C4 Z4 B& E8 N! @% q* o
"type" => "text",
) p4 p+ p) Y" y "box" => "social",
" f1 X0 l; X: F8 ]9 P8 s& B6 O5 \ "std" => "",4 o0 a% u7 s7 i w$ h
),7 E P: c: w, t9 L8 }, p
]/ {* v0 C; t L2 ?$ F array( "name" => "Insert Header Banner HTML Code (Header)/ d, N# f* {( M
<br /><em>*Recommended Size 468 x 60</em>
! o% ?9 I2 R0 v/ r' u! J <br /><em>*leave blank if not use</em>",
" d2 d" s" N; h, \3 O5 U "id" => $shortname."_header_banner",
! _! Q3 B! j/ ^( T; Y6 x; Q- V2 ^ "type" => "textarea",. k' C! L% J# d; C: [
"std" => "",
9 f" u1 w: f' W6 V7 O ),0 [ [; l$ J2 [( u$ Y
E6 w% d" |0 @5 `0 W7 Z0 A
array( "name" => "</div></div>",* K$ R# `" ~. k& L4 Q4 u
"type" => "close",
7 T( `, ?9 x/ H, V ),$ C7 v* u" _9 e( W
; I5 `7 _5 @7 k9 N* M
7 A8 d5 d: x ?9 ?0 T array( "name" => "Header Navigation Settings",4 X6 D( o8 k' O
"type" => "heading",
3 ^5 d* d6 E$ E+ t: e, b. [ ^' Q ),
! L% j5 i# L* ~" ~. F8 x! U4 ?! v5 S) i
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />9 [' P* @* [8 B* h3 c3 u
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />% q% \5 K, @! \) _3 N
<em>*Enter the page post ID number only</em><br />; z I, ^4 n8 H2 j9 C, h
<em>*separate by comma</em><br />6 b- O8 P6 {) u) {5 o
<em>*Exclude pages which you don't want to show on the header navigation</em>",
( r! a& V0 L( Y& y$ ~ "id" => $shortname."_header_page_navigation",
) m: x5 z _+ j. h "type" => "text",
6 Q: q- k" p6 x" ~- g "std" => "",/ i! o, k( U# e7 F
),
; l% s" Q1 a" j( Z3 n) Y3 T% u3 Y4 I
array( "name" => "</div></div>",
p! W! {7 Z; I8 [; R; ~" v "type" => "close",( m. X3 u& {! \/ U$ U( z
),9 L' Y7 z5 @( B* r/ J
( y9 l+ e, Q8 J
B) e _* G. W. `6 g% M; Y- r
array( "name" => "Post Auto Thumbnails Settings",$ Z* L- c/ L$ i! |2 D- B
"type" => "heading",
~9 ?8 N g! k9 E+ q9 K+ W ),3 a' k6 J1 s) {. Y1 }7 d3 ?
/ S; r7 N! q: ?5 g array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
& v9 E' B* O5 m5 F( D4 C "id" => $shortname."_timthumb_activate",
; y% W/ y1 H* F- W. x$ j "type" => "select",
$ F& Y4 T) h5 g6 D+ `* c "std" => "No",
9 C7 ]6 w3 f7 s- d "options" => array("No", "Yes")),/ v# m# W8 @* J0 w$ g' h: n% _
* x2 y1 r8 Q3 K array( "name" => "If Timthumb is enabled, Please choose its cropping method",
. F3 {% \1 I% ?8 I: }. W, m "id" => $shortname."_timthumb_cropping",: F ~+ R d% @
"type" => "select",' ^ R( q. u: |6 q d) Q$ G
"std" => "",
8 \9 g9 x Y* g4 {" u& l2 e9 e "options" => $crop_position)," b9 r. f; Z& d
5 c0 x1 L! E8 N- l0 u5 ?" l- D
array( "name" => "Insert Width Of Thumbnail Image<br />
6 j, e: Z2 j9 M& f <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />0 y: C5 _$ \7 K
<em>*Leave Blank To Use Default: 250</em><br />",
8 k. `3 ^! H4 L5 I5 Q9 p; S' J "id" => $shortname."_thumb_width",
6 c$ H1 i, h. n! P0 T/ P "type" => "text",- E# ]5 l! v" o* Y! u
"std" => "",. u; W S5 q& t H
),4 O$ n! o8 A% S! F0 d
+ Y! g2 u- g$ s/ D6 {: \9 i3 J
array( "name" => "Insert Height Of Thumbnail Image<br />
2 `2 h1 k. c7 K! \' h <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
+ G, R. @( N& z: ] <em>*Leave Blank To Use Default: 200</em><br />",# w# n# M) B+ Y9 V
"id" => $shortname."_thumb_height",
3 v3 _2 o% N5 ^: L "type" => "text",
; ~0 Q0 x8 \' @* w "std" => "",
9 T# }" a) i4 m& l ),
: r5 V4 N8 l+ A- j" j. U; Q; J5 p& t, j2 b- z
array( "name" => "</div></div>",/ V0 ~; R* r! i" J$ A" k& n& A: ^0 k
"type" => "close",) m) X: A1 m0 E# @9 z; X) h
),& `9 }4 G. E6 t! H7 F
C2 z1 n( `, J* e) @
array( "name" => "Featured Content Slider Settings",
- y7 v- b1 G1 o' @* M1 q- O "type" => "heading",$ z' N k. _4 @0 W4 P
),: _) ? |0 p+ Y' D; Q
- Q2 _/ q0 {; n0 S) G, G- P! L
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
1 e9 W" }) N0 P( K% o l D "id" => $shortname."_featured_activate",% J8 J) U5 O2 L( z( u- c0 c4 S
"type" => "select",4 G2 p4 X# v' S- n1 s s$ m' a5 K
"std" => "No",
. ?% f# ? |: j' T m" `% ? "options" => array("No", "Yes")),0 J. l; e0 \4 R
" N4 Z$ a$ f0 t9 o7 l8 K/ P* O& _0 \/ \2 ~( R/ s% R- K
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
9 D4 u; T3 {: B& u; R "id" => $shortname."_featured_category",# ^: Q/ m9 a ~4 P/ _5 u& {
"type" => "select",1 s/ O6 P' ~3 Y7 |
"std" => "Choose a category:",
7 s' d4 U9 J6 ] "options" => $wp_getcat),
/ ]$ |. H& T7 R; y/ \" M7 x) _+ Q8 `+ @% G* F0 i2 G
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
4 Q& A0 U L/ X& E "id" => $shortname."_featured_number",
! N1 a" T7 a# f j. U "type" => "select",% O( s- i$ I# ]6 \) ]6 _# M6 A
"std" => "Number of post:",
6 [) [, E! e2 D$ \, D "options" => $number_entries),7 m& X! X9 r |$ {
! x$ ? e3 g9 T$ ^8 `) C, w array( "name" => "</div></div>",, v& F9 r! J7 U5 p) L* a8 L ]
"type" => "close",& Z0 \7 l2 f& X* e5 t
),/ X& m& z: `9 G! g
% C3 w; }7 c I+ |& t' B array( "name" => "Featured Category Settings",* n% Z# J/ r+ Q0 J
"type" => "heading",
" q3 b/ r$ p3 \* [$ t, B N )," M2 `& ]6 R+ M6 s! a
. R0 a, L+ k) O5 J* [* s6 R" d
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>", k" Z- m9 `' k2 v
"id" => $shortname."_featured_category_activate",- p( ~3 k Y( q
"type" => "select",
- b4 b& q: Y& t& k3 d7 G6 A "std" => "No",
' R* t: {, \; R$ }, ?( ?4 V "options" => array("No", "Yes")),$ p! d, ?; J( E, S
) K( f1 l, }* O6 w8 G! o7 M* |
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
9 Z7 u7 [- y9 {/ {2 y1 M# [' y4 a, Q "id" => $shortname."_featured_category_id1",( ], E. Z4 ^8 N0 B$ T
"type" => "select",9 p" o9 C, u6 b/ m, Z
"std" => "Choose a category:",
' `2 |% y( l- I o "options" => $wp_getcat),
2 ~, e7 `- x. r & T/ v7 f/ f# p* |
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
' w' u: s5 H0 n2 m "id" => $shortname."_featured_number1",: G- ]" {; L% j3 a8 w
"type" => "select",
1 v: m- U, \- e( A8 i" O- j, | "std" => "Number of post:",& ^$ f/ N* V/ e5 |8 X. {( n
"options" => $number_entries),. e* @- s2 U; A* K2 z7 w
: n, x/ H8 g' J% Y' s2 w; v
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
, Y! L2 Q1 w F4 F! G "id" => $shortname."_featured_category_id2", i7 q+ T. Y! D! M7 W2 Q
"type" => "select",
, q1 R, e& l8 j) d' B8 Q "std" => "Choose a category:",3 G+ Q5 X) C: g/ ?7 ^
"options" => $wp_getcat),/ @, ?& a$ ~# i9 W& {
& f) F# i4 y* \ array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",' I* Y6 @1 N, _1 H. @$ x
"id" => $shortname."_featured_number2"," H& f. D) m5 b: W- r3 @+ i. l
"type" => "select",
" O7 e+ J" [( B4 Q. r% \ "std" => "Number of post:",8 T8 w0 c6 [1 j8 ]4 B4 [ X, z
"options" => $number_entries),
$ y: c0 j3 q$ z9 K 8 l0 Q& U' f8 G! M8 l- I
4 {1 V: P; e3 I* G! S' l T
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",) _, Z8 n# l8 |# Z; n
"id" => $shortname."_featured_category_id3",
+ `; ]* V8 w$ B "type" => "select",+ R( b3 y6 B' |/ a' q
"std" => "Choose a category:",
1 [1 |) j$ O) I, s "options" => $wp_getcat)," f6 |' r2 O, I( @! v5 i% L
; d, o8 D* g- P9 F/ V array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
" ~' D e; }; P; c "id" => $shortname."_featured_number3",
/ c7 b, |* D. N3 t: E "type" => "select",2 T% }0 S' a; S
"std" => "Number of post:",* h% }$ e6 a! D4 v
"options" => $number_entries), i6 G% B p: i1 g" m
; c" J s. d9 F/ i" y3 e9 l# g# q( U' Z. m. t; \
array( "name" => "</div></div>",$ S# l: \1 F$ ^9 F8 \
"type" => "close",
1 o+ b- i' j* f2 ^( `, t& L ),0 C; t' r$ _ N! e1 [
/ I4 i! H5 K" L1 l+ h4 n4 m& [
array( "name" => "Google Adsense & Analytics Settings",
# X6 A/ z/ e, } @2 [) Z$ W "type" => "heading",3 n; T d4 T; x! \( D" A
),+ b+ ]! d7 `6 i9 S
' U4 G5 a9 \* F6 a2 [% i& Q array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
8 r; x. Q& q7 s) L4 k) \ "id" => $shortname."_adsense_loop_activate",- F6 y; D: T" ?% i: M. C
"type" => "select",
0 e5 V) y5 a8 B# ^ E3 q5 _ "std" => "Disable",
/ J/ B* c7 Y3 X9 p "options" => array("Disable", "Enable")),
* Z/ b3 I/ v1 V0 }+ F! h( K( \
5 }2 ~: N: \) n- O' u# c array( "name" => "Insert Google Adsense Code For Loops Here<br />
$ W5 `/ g/ P( Z <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",% g# `9 r% F" {- L4 D% h( u# {! p
"id" => $shortname."_adsense_loop",* M; O7 h7 l. H4 q: j7 {" C
"type" => "textarea",
F" y( W% B# ^# o) z/ @ "std" => "",
! M& _- G: f* I- ]3 M- M ),, ]5 k" B. @, I( q! i, q8 z* G
3 M6 o% T8 h8 D) Z+ O, C7 t: r/ v4 j array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
1 i1 j( n) @$ j "id" => $shortname."_adsense_single_activate",
1 C/ D" j5 k; y0 r% J Z "type" => "select",4 t1 R* G5 Q7 Z6 P
"std" => "Disable",/ f" M1 g+ }6 p/ V5 u& j/ J
"options" => array("Disable", "Enable")),
) Y( B* _: q2 v5 t5 v8 r& z/ S3 P2 i! B/ u. g
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
! d% K/ V* A; S n: `7 h0 o <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",) a9 W; ?7 n0 p' _, r
"id" => $shortname."_adsense_single",
7 y* c4 ]/ J4 m! d2 p "type" => "textarea",5 R; a; U4 ~$ p+ W E% W
"std" => "",
% s9 b0 b, R. L- q8 a ),
) b- w, ]& Y) i" C L$ _
, V, n4 I+ l' ~$ Q1 q f6 V4 o" w7 T; r& }
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",) p1 R9 }) u) G* ]
"id" => $shortname."_google_analytics",
1 Q' B5 `8 z5 ` _ "type" => "textarea",
; x* S s4 R1 r9 x "std" => "", k5 j$ L# D7 k y; F% S
),8 \3 g' L9 T9 M/ |) s9 H7 V! t1 Z
6 d( ~+ ~7 R6 U K array( "name" => "</div></div>",9 \0 N! G1 } i. e, e: E
"type" => "close",
; d/ ^2 i' b0 i5 U0 f ),% b. a0 ]: a5 A0 N+ [+ M
/ i; g, _% g9 g
$ A1 G! I d+ `2 E; c/ W1 N array( "name" => "AddThis Social Bookmarking Settings",
* N# p0 u8 `; T7 o9 | "type" => "heading",
* o' W& c5 O* _0 I" T7 u1 R1 h# y ),
0 a4 ^& Z% D b5 j+ i& b
& p/ I- ^9 z Y: M( W8 R array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>5 G% V3 _; V2 \7 G' g: @
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",, t J7 o, _. j" c6 j" i: ^
"id" => $shortname."_addthis",
! \* M4 i$ v" }, e' y "type" => "text",
9 {' M1 s3 S5 P3 | "box" => "social",& l7 \1 X$ r: f( y
"std" => "",; t, v, f' q) ?8 }
),5 w5 H/ N- v# V9 s( i( `
0 k9 ?6 Q7 T+ P! H9 n- V
array( "name" => "</div></div>",
9 K+ }5 n' l# d A9 y6 s1 z9 m "type" => "close",
+ @. `3 J4 ^# i4 B+ Z- [& p4 n ),$ C$ P/ ^6 o2 i. X0 A9 h
1 a3 g2 }' B/ D , e- N; I- S0 i, E
+ N' M: `- \, W$ E) [
array( "name" => "YouTube Video Settings",
* r+ c; a6 R' [& x" a% Q4 e8 \ "type" => "heading",
4 r8 D! I" F' k0 `/ [) Z" { ),& T! G% @5 p2 n- G& }/ e
9 l8 V" N; R+ h* [. Y) C5 ` array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",6 `( \) o; d+ Z: O; w) R, V! v
"id" => $shortname."_emvideo_activate",6 ]* z4 E. F; {7 c
"type" => "select",
e3 A# \8 t$ W: ^7 A "std" => "No",
2 s$ G2 F* s+ ]7 L' |1 I "options" => array("No", "Yes")),
6 H. J! z' z9 d8 } ]; t
8 V; G5 g _- v7 w' K/ O array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",4 ~( u: F! {! U4 M6 T
"id" => $shortname."_emvideo",$ Y, x) Q6 {8 E" F
"std" => "",
8 H' n; w& i8 {$ j2 X; m "type" => "text"),
+ Y) z |( K9 U- Z
9 i1 q) b/ f$ X+ \9 T+ _* a( I array( "name" => "</div></div>",; K, @9 o( ~1 I g4 [
"type" => "close",
6 R9 Q# V/ K$ g8 t5 D ),
7 h/ Y4 L8 p7 ] | - j' ^0 y2 p7 B8 A
array( "name" => "Twitter Settings",) D+ T: b% `, c8 m. r
"type" => "heading",
' R2 K) [# \' N/ g- I5 O$ x ),
/ V, Y1 e9 L, A3 r4 F' ~+ }" C. w8 X O* @4 S& f
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",2 Z' Z" ^( j. l/ a' W+ m
"id" => $shortname."_twitter_activate",
8 M% t9 N7 S8 G7 h% X8 n "type" => "select",
8 B6 F. I% V- ^2 l- J) c: x) y "std" => "No",
3 O0 o( K! P( M3 ]2 j3 n& i' ] "options" => array("No", "Yes")),
) g- e- z! K8 y& k$ {2 H3 K0 A% R0 X3 ?. e: B
array( "name" => "Insert Your Twitter ID here
9 [6 P$ o Q% }. o9 [ <br /><em>*leave blank if not necessary</em>& m6 f7 i k- [& Q9 P4 B' H7 {
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
/ J2 K \( {9 p2 ]. `) y7 Q "id" => $shortname."_twitter",
8 K% {. `0 W& }( r, U "type" => "text",& n* A- z; m3 |' T- Z
"box" => "social",
4 q2 d* }2 {: W- A "std" => "",3 D1 f& Q; w! `" e8 C) A
),
1 L" ?0 e0 p) o$ |4 o' ?) u9 s7 b* _7 z, P5 ~4 E% M
array( "name" => "Enter Twitter Feed Count here
5 F k# y8 t' M) P9 ~0 u4 K <br /><em>*leave blank if not necessary</em>( V9 _- t) G2 [- I( B; K+ @* G
<br /><em>*Enter How Many Twitter Feed To Display</em>",$ D* v& K0 G8 n" G7 I9 V
"id" => $shortname."_twitter_count",
0 o. S4 T2 i* I: c$ ~. P "type" => "text",& e) C! N+ l/ U/ f6 N
"box" => "social",4 c+ G9 c$ I& \* ~' F0 P& |
"std" => "",
* Z4 I- b! s3 Q6 T ),: V3 m* U+ t. L+ V- i' W9 I% H
3 y1 e9 `4 S R2 |( v+ E7 }! M: l array( "name" => "</div></div>",3 o; X: @; n! v$ ^- l% T' k
"type" => "close",
* G6 k( S4 P0 S9 E ),0 `( @1 e& M( k9 e# |$ ^
* K+ ?9 R' b8 o1 L! Z
$ u4 e% B9 V# r8 D+ [ array( "name" => "125 x 125 Banners Advertisement Settings",6 S- T7 d" ?( E9 j7 u
"type" => "heading",
- {( B, s' S& C7 j1 S# K ),6 [" f: }% z8 v+ Q. Q
+ a9 K8 Q2 I: x' p1 ? array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
. P6 T n$ k$ i6 b5 a "id" => $shortname."_sponsor_activate",2 ]1 w; a2 V6 V o
"type" => "select",( ~" ~/ W6 n( i
"std" => "No",
$ [8 o6 g* T7 n( j" I "options" => array("No", "Yes")),
) d' B7 M7 e/ D
" |$ g4 r' h! \! s8 V! E
9 r$ A& ]- @8 W& u array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
4 h2 p R0 y2 a "id" => $shortname."_sponsor_banner_one",9 t7 C3 _7 \8 Y& o: c3 B2 N
"type" => "textarea",
8 W* S9 P. i2 H( J# n "std" => "",8 f" s1 K# D: n( w( l
), ! O1 T8 ~6 u8 W, [
8 G5 Q9 p8 w, ~% y, T6 g) U/ [ array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",& d' U/ {& `7 _' N; q
"id" => $shortname."_sponsor_banner_two",' ^4 n& d+ F; R* o7 ]
"type" => "textarea",: L4 L) h$ o% @* j5 d8 ~8 ^
"std" => "",- V1 _8 s$ D( F6 h9 Q
),
0 w6 w8 Y9 w! B7 s8 i& h. M1 H3 |0 w
7 m3 Z1 o1 c4 z! u' J; b8 @# K) l array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
; b. F9 g% k2 X0 N! q% Y1 j "id" => $shortname."_sponsor_banner_three",5 t& S+ f7 b) |7 ?% q/ ?& V( e
"type" => "textarea",
W! [3 z: F# V* R "std" => "",
& S5 p, S, Z' \, w1 p) ?* g s ),
& ~9 A6 l4 L$ ?+ ]* t5 {7 {1 b/ `: ~1 `, L2 R3 F
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
' U# R3 y3 o' T8 e& u "id" => $shortname."_sponsor_banner_four", J- X+ q) h; g ? {% l5 z
"type" => "textarea",
' X0 y2 W- L" }2 d "std" => "",
% n9 M2 Q( M4 O3 }# m ),0 D6 D! j0 u2 `% }2 @- U% v$ X
7 D( W. B4 I- J( B array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
3 l5 w+ M1 k# c6 I "id" => $shortname."_sponsor_banner_five",1 u3 w E3 Y1 ~2 z/ Z/ c
"type" => "textarea",
9 T3 Q" u7 \% l "std" => "",$ J% ]9 L1 _ E' P9 P |. A
),
3 [' j1 p; V* O) X
; G+ ^$ C7 h" N; A. @% } array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",( O! b% H% W8 @( R: t9 \ A2 J$ W
"id" => $shortname."_sponsor_banner_six",' C# S" ?" d% U
"type" => "textarea",
3 J% r+ [- J) U" C "std" => "",' E; ^4 X9 [% q/ d1 Q5 R
)," f5 L/ |8 |! W5 ?/ B/ W( l* I+ e
. e% ^9 w+ \3 F1 ]/ }6 \
array( "name" => "</div></div>",: R3 Z, o' n1 Z' v- ^0 J. _
"type" => "close",8 G+ S) \1 R! @1 E* o R/ c' L
),8 q5 w3 z, r: O1 j/ l" K' E; V3 p
3 `" o a, V" [3 ^5 s
4 {, x d7 S) @* }- v+ y
; B0 _) m4 m1 k1 \7 q);
4 r+ J1 G9 \7 O \$ e! c& s- k) n9 _6 l
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
* o% }# r8 h, D4 I4 C( h) j
% l. g& C U1 ^2 o+ h/ ]# s. _echo "<div id=\"admin-options\"> ";
7 h. \* B/ |" |. d+ Y4 E* R
% e- R/ \) @9 w: ?$ ^: r" dglobal $themename, $shortname, $options;
3 l7 g6 @# W, a- D( Q! dif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';# l4 ?3 j+ M' K7 ^/ o
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
3 n }; y6 |- U" I, ~$ F q ~2 v# J?>, z& |( z' c$ W1 I
$ J9 Q8 Q& k; A3 x4 f) a5 p
<h4><?php echo "$themename"; ?> Theme Options</h4>
6 k. x* M3 [/ R2 N4 ~5 ]; K/ I" D
7 ?9 F4 m. |2 M# ]. i+ }<div class="annouce">, J& N& @5 G) X7 X% o* z
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>( ~$ e0 N: m6 x, f G+ K
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>+ v1 [% e& w" i
</div>! Z. Y3 I6 \" O5 V( ~0 i% ~
) ^, U/ I0 Q" U! n5 `0 K5 E' a3 z, i<form action="" method="post">) B. T1 d& j* V5 j$ P
$ a+ i5 Y5 y" K7 @6 l
<?php foreach ($options as $value) { ?>0 @; N Q4 |$ _# @& [ F) u, ^$ V
* Z4 h, o: j4 ^! J6 R% n
<?php switch ( $value['type'] ) { case 'heading': ?>
. E- V; a9 _ G: `5 ]' Z% T J# a4 U8 E) [/ D8 h
<div class="get-option">+ X* x+ \. r. E3 z' s% f
: S2 o1 w5 g1 p$ h3 r3 r<h2><?php echo $value['name']; ?></h2>4 o$ K9 X8 j4 ~
2 \3 @" g7 M% q
<div class="option-save">
$ n; R* o/ F% k& e1 s/ x X9 Z& D
<?php$ F8 J' a9 r; \! @
break;1 [; } N- C- S
case 'text':# r" n3 D1 y( |! B: _# E
?>
+ l, X7 y" q' c8 K
' S) D0 c) {: `* s6 c) s7 `<div class="description"><?php echo $value['name']; ?></div>
4 Y$ ] V1 @! d2 B: n<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
# M5 r4 m3 [& y9 o
0 K$ U7 M+ ^8 r3 `get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
# T: ]$ |* O- \: H' \7 f0 c, L
<?php2 A! }* Y+ W7 |7 M {8 f
break;: V. _6 J3 i+ c' P c
case 'select':' w# i% v( u! n+ j
?>
4 _* g2 p% `4 H5 f4 ]5 ` ?, o. ?; b6 I* C& p
<div class="description"><?php echo $value['name']; ?></div>$ R4 x( j& Q) T) H+ l
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
, }8 o* {% @; [; C<?php foreach ($value['options'] as $option) { ?>8 [& r& K1 a* g' y! V* a1 O
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
+ l6 V- W+ H) ^( r ?, F) Q<?php } ?>5 r) l( X! H1 @$ t8 U5 J
</select>9 M( o- Y9 `0 T6 _. L/ B4 f' j
</p>* i7 A& u" r& n
* S0 ^1 P% B1 d$ U8 M<?php/ u9 v c1 F* t- x
break;# B# C( _" Z+ V- V) N3 ?" U/ ^
case 'textarea':- U3 w- O8 n& j+ q4 l# l
$valuex = $value['id'];0 z# n1 \) F$ i Y+ f
$valuey = stripslashes($valuex);
& a% e+ ?: w1 ?7 ?: ?$video_code = get_settings($valuey);
, w; W& @4 s) A8 p2 T' W?>1 O V0 f- |& a: |9 L8 q
4 ^7 T% h0 r0 R! F' T7 t: o<div class="description"><?php echo $value['name']; ?></div>" K' D' r0 I8 `
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
; D; U2 M3 a9 S4 j7 F% G; T- l6 p. m M+ M
else { echo $value['std']; } ?></textarea></p>( F7 |6 x- Z! q( B+ J
/ r0 h1 n& R1 g1 t9 V% I' K<?php
1 F; \0 r; G/ Q% O9 J f' Kbreak;! C, J( \/ W- M8 V8 |/ U8 M
case 'close':& ]) A5 Q% M4 t' ?. v( V. Q
?>
# F1 T/ Y; L4 M b6 g' Z6 h$ n! {5 N9 X$ e9 w( l
<div class="clearfix"></div>
& j8 Z# B8 p, H0 B3 k</div><!-- OPTION SAVE END -->2 W- F! O u1 v
0 ?0 @* Z' z/ i7 |+ |
<div class="clearfix"></div>$ b9 A! ]4 k+ X" l5 @ ^. f: m b
</div><!-- GET OPTION END -->
0 b. X" K$ q( Q% c
3 W- t* i! v% s# G<?php
3 ~$ T. c. H+ g, z! d4 q% [7 B3 Q- v) bbreak;
. X q/ `! ` _( a4 l, |7 f+ p! E2 J3 Adefault;+ z( x# x0 f+ w: L; G. z
?>2 f, j0 b5 q1 Z; [
8 s) F, f7 v. a& Z m7 N x
q1 N6 P6 G. {" T! J: a1 p0 Z0 |<?php
6 c7 W5 _- A5 P& v4 lbreak; } ?>1 }1 F4 \6 B, C' ]6 \2 R" k( z
2 C8 G+ o& N- h& W# R/ _) G
<?php } ?>
2 ]; P- r. Y! o$ [9 {
' [9 u# ]% m4 h! M<p class="save-p">
2 [' r7 ]$ p( c8 p! y9 u; X9 I<input name="save" type="submit" class="sbutton" value="Save Options" />9 G) W! n1 X( w
<input type="hidden" name="action" value="save" /> M+ U1 y9 G# l r. |: n
</p>
& |8 s8 }4 {, _" S: |</form>8 t. s* S0 Q, M7 o+ o: _
% d$ ]) F$ z, A
<form method="post">8 |* X* q: }; x/ U
<p class="save-p">1 `" I$ _9 h; F9 ~6 u7 o& m4 `
<input name="reset" type="submit" class="sbutton" value="Reset Options" />9 l& o( p3 d* H! i Z n3 C- J# x# }
<input type="hidden" name="action" value="reset" />! u+ \) ~- A- I4 M4 c2 H
</p>* N. ]7 K( s: u- d, B+ X. G* T
</form>
$ s+ d) z% F. ]1 `7 d; Y$ ?$ @/ S1 m1 b: }# y- ^* o
</div><!-- ADMIN OPTIONS END -->
8 T, w. Q: }0 {. D" g3 c( y- W" s/ A6 I# M
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }, ?6 R) N+ Y. P o2 h- c) G! R6 f
/ V" P. D& n* K2 V6 {7 Ffunction mytheme_admin_register() {0 k: c) j x" R1 F
global $themename, $shortname, $options;
2 e: a3 h: h: Z& ]0 r3 J4 Sif ( $_GET['page'] == basename(__FILE__) ) {
, B/ }1 E* Y( r6 Eif ( 'save' == $_REQUEST['action'] ) {9 U+ b: W- m0 ]1 n
foreach ($options as $value) {& q7 _% X& T5 h. f3 U
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
, x. {1 H2 S! N( N3 {7 mforeach ($options as $value) {9 _9 v- K" v: U1 c: @: n
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
: }% ]) `7 n$ t2 uheader("Location: themes.php?page=functions.php&saved=true");7 H2 s, m0 N! _8 a e
die;
& ]" n. F1 q/ S- |3 m% ]5 z1 S} else if( 'reset' == $_REQUEST['action'] ) {
4 v9 T' a7 S7 u# w7 e& dforeach ($options as $value) {
; x( {$ l0 M' Y0 {) {" a+ _3 jdelete_option( $value['id'] ); }- C8 J& s+ d0 }/ C; S
header("Location: themes.php?page=functions.php&reset=true");
0 K4 d: z/ }: idie;9 N4 T- l5 g# @9 ~' a
}, ^! r% M9 Q4 O2 e {8 c
}
9 W( A, w0 G: \! c3 O- hadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
- O6 ?4 m% Q# A7 q}
0 J# s9 r2 f4 N- }9 }" L& ]6 o& I9 c
function mytheme_admin_head() { ?>
/ U$ s8 C( R$ {8 P+ j* S1 A<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />- k: e+ X( i" A( Y1 s
<?php }
J4 c8 G2 d% n4 Q6 } |
|