|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
- W( {; b4 K( ]5 M3 x/ d( ~$ B" {/ a// Theme Option( d, F# a: K0 F h4 C7 U* i
////////////////////////////////////////////////////////////////////////////////7 e. _) ^2 v7 z6 }7 _, ~. T
1 {' a) P/ J5 M0 Z2 d$themename = "Zenx";2 Q: c6 q1 J( G
$shortname = str_replace(' ', '_', strtolower($themename));# X6 C2 h+ d7 p- T/ m( i% q
( O, f9 t3 |4 I" a3 D, Ufunction get_theme_option($option) H+ U; C/ D9 j U1 L: c
{
3 Y5 P+ B% H2 p* g global $shortname;- I& o1 T/ |6 G
return stripslashes(get_option($shortname . '_' . $option));
6 J! N) e0 k4 f& i" {* X- n}
0 @! k. s, p1 j1 l+ J" M- f$ R
- \& q4 G0 t) K$ I6 ?1 H, X: afunction get_theme_settings($option)
9 Y1 v; Z0 V3 q- X5 R) t6 v{
- f( @; u& ]+ E. V return stripslashes(get_option($option));
: T" d* q; D; q8 Q" _/ w+ r: z}
8 b; [, `. M5 Q' R1 c$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");. X n0 k9 b) j( Y0 w! J
$wp_getcat = array();: c" A, v3 @' ? [; X3 d
foreach ($wp_dropdown_rd_admin as $category_list) {0 E2 i A% H0 E
$wp_getcat[$category_list->term_id] = $category_list->name;
! \0 a1 ]4 y8 G) ]}
: S1 D/ S+ F/ W' H$ r7 O$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
8 |7 m: I1 {1 V$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");# }5 m4 z8 m" W8 B8 o& f7 a
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");2 z( \# k. `3 s( F" y
1 n: y9 ]- Q4 f$options = array (' v7 h" U' f& c$ n4 d0 N1 C
5 V% y" d: Y4 P/ L" T
0 c/ A+ j; H9 ^( I/ h array( "name" => "Blog Header Settings",2 K% Z$ L4 D% U
"type" => "heading",
; I: e" N$ d5 x- N3 \$ \2 K8 v! m8 @ ),! \0 w1 {: W' D8 s; [+ F5 s6 f! r
+ ~9 p( c9 g5 q
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
- Y1 U' {+ ` d9 M; t& S "id" => $shortname."_header_logo_activate",/ Y) R" ~, T5 B! u4 j8 `: m7 H
"type" => "select",
9 }6 Z! T5 |0 U "std" => "No",
2 C- g: Q6 A! s- I0 K "options" => array("No", "Yes")),0 o) h1 C S v: d% y* y, K+ g
5 _! c1 y1 Y6 z9 x
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
8 ~9 Q0 a0 S. g* E5 h5 s* k5 i "id" => $shortname."_logo_url",
( P; @0 S6 W, S% g0 j/ Z* g( F9 B "type" => "text",
& A( C$ g+ ]; y0 ? "box" => "social",
# b( ?4 d# j3 B9 V "std" => "",+ e' G D |8 l# g* [0 k: C( C. |
),0 T% o7 Y3 z! j2 [" X# G& x
+ q7 P7 l2 w$ S$ J: ^9 z
array( "name" => "Insert Header Banner HTML Code (Header)
1 s H% P- D, I8 B5 c* u; H <br /><em>*Recommended Size 468 x 60</em>: O; \+ i/ h; P# G
<br /><em>*leave blank if not use</em>",9 ~8 E C9 W+ D, F/ G
"id" => $shortname."_header_banner",
9 `* |5 I# P* K0 g% N0 Y "type" => "textarea",
2 H- Z" ?! ~0 R- e "std" => "",) m: v' {7 H- Z$ Y
),( i7 i! c0 J2 Q3 Q/ s% q
; F) K9 R$ e: r# T' Z
array( "name" => "</div></div>",6 ^# e) c! w( I+ d
"type" => "close",: w+ |3 N" i) J+ e
),/ O7 K: E: M! w8 I r
5 O. i4 o# {% M9 u0 V% U
. M* Z# R: o* r/ I& ]% N7 p# M" O array( "name" => "Header Navigation Settings",3 ?6 \. B' [! W, s6 d! w* [1 M# O
"type" => "heading",& Y( |3 ? c7 d) T
),
$ g, _1 v. _1 |9 ]' T/ W( w E' y5 L$ c2 h
: R5 }( r3 C0 d* x) R$ _1 ^2 s array( "name" => "Insert Page ID To Exclude On Header Navigation<br />8 A$ g4 g0 r, j2 J
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
! g. h5 R7 @. A0 w- r& i2 _3 C, ?4 E <em>*Enter the page post ID number only</em><br />% A& v) v0 a- j: q% I, ^
<em>*separate by comma</em><br />
2 B- A, b$ _/ I& v8 U/ p <em>*Exclude pages which you don't want to show on the header navigation</em>",
3 M" {% E# x: ^+ i. ~( u, W* z" H$ ] "id" => $shortname."_header_page_navigation",% D P& v6 Z6 _% ~7 q+ ^
"type" => "text",
% s2 z. [: `; s "std" => "",
W0 k8 e9 I8 j ),/ F* k# {5 {6 f! _/ W7 A
2 S6 f! D$ h. R0 `. H! }. r1 c
array( "name" => "</div></div>",
$ X2 x( B# \. g "type" => "close",) a6 S( i" s& Y+ M
),
: }% Y6 F* O5 D( V& S. d
0 T* }- n) ]! _2 A/ y( W
( t: u! q! q5 m# V, i9 A array( "name" => "Post Auto Thumbnails Settings",! x# ^3 `* X3 @+ r& X! \; v7 j
"type" => "heading",
. g3 A2 s9 e9 j" p9 P: m; p ),& Y3 K+ S1 d {" k4 M& d7 t. h% ]
& `: I4 x5 i4 @- X# J3 N& M array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
5 j" d; R) j( J6 ~ "id" => $shortname."_timthumb_activate",1 H7 k1 ?6 M3 w( F, q4 k, F* W
"type" => "select",
1 Q' z$ K! Y* q8 f/ a% h "std" => "No",! a8 b$ E4 J- O6 g4 c
"options" => array("No", "Yes")),. `# w# j" \+ ?; k; \1 ?( e
/ f8 r3 e- S( J7 l, M array( "name" => "If Timthumb is enabled, Please choose its cropping method",
/ ~% G! `5 ~ E0 _' Z* q; a "id" => $shortname."_timthumb_cropping",
( u% ~2 n- V) m: p "type" => "select",7 f) e: X9 k, [' D
"std" => "",
6 f# u% |; i# r2 U. P- N "options" => $crop_position),
. t) L* J- J% e
8 H9 \" J% ]2 F: e- ` array( "name" => "Insert Width Of Thumbnail Image<br />0 L/ J8 H; J* V; K+ N7 ^4 e2 y
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />: w2 T8 f# T+ v" w; n5 c
<em>*Leave Blank To Use Default: 250</em><br />",+ Q, ]2 I0 ~# T* p
"id" => $shortname."_thumb_width",
! |9 O) d, {7 ?; ^9 W1 x "type" => "text",
7 }0 f+ A- C; f. d "std" => "",
3 Y$ l ^" y- P& W9 K5 F; [ ),
. l# q) P) k' G! O5 N
, W; n- _! A" f$ [: ^8 x array( "name" => "Insert Height Of Thumbnail Image<br />$ ^4 B1 H, w" s" ~
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
2 ~- L5 m. U5 l3 j <em>*Leave Blank To Use Default: 200</em><br />",
+ I7 G/ K2 N( i "id" => $shortname."_thumb_height",7 F: X5 O" W" H3 p, P* f/ V2 _7 g6 @" T9 H
"type" => "text",
1 A1 {$ k& ^9 d "std" => ""," `& P" E" U1 }& \ u' g1 L
),
( g1 Z4 e+ m8 j4 W$ c; k3 X! U) G* @% m8 q. y6 I* }7 l
array( "name" => "</div></div>",& E1 R2 r @) n8 N/ Y% p* e
"type" => "close",
8 w$ b d) m5 n( q B) z# A ),1 [2 o. x4 [' S# I4 t) R
6 _2 ~- E$ q: S4 ?/ f$ ~ array( "name" => "Featured Content Slider Settings",! k5 t4 f Z3 r- E
"type" => "heading",& i0 V$ I/ ^; N ^' [
),6 n4 I9 e1 e/ @; T& T0 | L% N6 z \
# W" V' c3 U# \8 b
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% A$ g- h7 ~9 A- \: o "id" => $shortname."_featured_activate",
7 |( ^6 [$ S0 @ i; ]0 _/ J1 z "type" => "select",3 V% {" ~/ I" S
"std" => "No",
: E0 S( Z: G1 E, Y; { "options" => array("No", "Yes")),
% }0 }' q1 l- U% m, N& E- _+ H4 c! k% U) U+ W# v" w( ? H
3 W# s& g, ~& s" r
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
7 n0 V3 l0 d# i% v. i, k0 J; o" | "id" => $shortname."_featured_category",
$ A1 N$ o: d( X8 s7 |' N0 ` k "type" => "select",/ \6 B; C1 D7 k+ z
"std" => "Choose a category:",. K( `$ K8 d! h* M5 ^
"options" => $wp_getcat),
1 }( T7 V" c h7 n6 h1 D+ }7 q
* L9 }2 ^0 h$ i. k! f' I array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
6 r( s9 d, h+ H6 S/ J "id" => $shortname."_featured_number",
2 d/ P5 u6 H x# [/ z i "type" => "select",9 u. j* \- e* h; Z# n
"std" => "Number of post:",
$ M" }/ w1 h0 L8 _) H "options" => $number_entries),
' D/ h1 F5 Y+ w: _( s* m8 @+ f% C) M3 m/ T% |6 G2 y
array( "name" => "</div></div>",) Z D- r/ B, B6 a4 Y
"type" => "close",9 Y( {% }) _ ~: ? m
),1 W5 O2 z/ g; i- `
& F: Q4 w2 F4 ]% c4 l, c array( "name" => "Featured Category Settings",. v# P$ L! ]) b% ~0 k
"type" => "heading",
/ ?$ Y+ Q& v$ g5 w- W4 |! m ),) h3 W- B5 v/ h! R8 `( q! r
( `3 Z, H1 H, t
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
* i( @7 g2 j z* U) K7 a "id" => $shortname."_featured_category_activate",
- K; A! k+ \" X: b( D "type" => "select",6 G8 H3 e2 q4 c& U2 g, W! q O
"std" => "No",1 i6 `8 B& G* ?5 e0 [, d4 ?
"options" => array("No", "Yes")),
; `6 q3 y, o1 A9 a% M( a 4 O) I1 z8 b2 q. C' C) ]
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",: y5 o. H1 I8 b |
"id" => $shortname."_featured_category_id1",7 U# A/ J+ t: {/ g$ b% Y3 X
"type" => "select",/ f4 T! E, I# \; W' T
"std" => "Choose a category:",6 @4 b% C' E, j. r) y
"options" => $wp_getcat),
# [ x& Z% [* G
# E9 D# |! v% k! e, s u* q array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",4 b$ g8 m5 Q6 v3 ?- N4 T% G
"id" => $shortname."_featured_number1",
f: X4 c; w* q) b "type" => "select"," m' b2 X, h7 s" l# M: v( ?& `
"std" => "Number of post:",
& B4 n( g. V$ q6 ]% T, n' m "options" => $number_entries),
) H2 V1 i( u" Z5 |0 g, f; I
8 R* k4 _) X5 W o c/ n array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",' W- I- @( `4 n
"id" => $shortname."_featured_category_id2",
* R" B4 p7 M4 ]6 S. w7 k "type" => "select",3 T8 j l. } q p1 G
"std" => "Choose a category:",7 t( Z6 L7 V9 G4 I; O; p# B `
"options" => $wp_getcat),2 j' @% e2 _7 A! C: _
9 L7 X; Q" I9 {/ I8 z
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",$ |# n; o {! W0 {
"id" => $shortname."_featured_number2",
) J. ~% \3 c& k. j, P "type" => "select",4 {; }) U. D4 _3 y# R& K
"std" => "Number of post:",
% n/ A+ L3 M6 h "options" => $number_entries),! ^" P4 B k( K
z3 q/ N k( P a3 N2 j( X! F Y
5 [6 `5 d1 l$ W9 L array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
/ S- A$ u0 l4 C$ a "id" => $shortname."_featured_category_id3",
: z' R/ C- }8 h9 n% B "type" => "select",4 x4 D; w" E1 `) ?* X3 G8 [/ S# E
"std" => "Choose a category:",
5 y# n1 n. Q0 N% C" r0 T3 K: _" v4 L "options" => $wp_getcat),
* P# R( h6 L7 |
/ |+ ~7 }- [. D- Y3 I# v7 ` array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
3 j* y6 Y: c @0 S2 G S+ M "id" => $shortname."_featured_number3",* k; k5 H6 p+ r- Q) i/ a
"type" => "select",
; Z+ A' V" }: ^5 U8 b6 U1 I$ | "std" => "Number of post:",
. g i3 a4 S+ G6 N, e/ E% v% Q "options" => $number_entries),
4 H+ E5 G5 g" K% E' ?7 t) M9 l% E/ ]6 h. J! f* P* O
2 k2 Q" M. U" d
array( "name" => "</div></div>",: E+ _/ P0 C/ g( D, S* I" V) b( I! l
"type" => "close",
' w& q5 }4 E1 s; u3 e ),6 ^6 K% ]4 B6 @; J' X o
% T4 l3 q3 e3 @# U
. u$ c& G8 c9 l6 A5 L
array( "name" => "Google Adsense & Analytics Settings",
( J; a, O; b+ o0 W+ \' n "type" => "heading",3 V/ h/ D% D0 h- C9 t+ P0 t& h
),
% \0 R+ x' x D5 j' [3 ?, P9 y u
' ~- p1 f- L$ W array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
5 f" N/ p" A" m7 j. h! o "id" => $shortname."_adsense_loop_activate",6 M/ U. }. i1 n1 o' E
"type" => "select",
1 d7 T8 @" k! b, n "std" => "Disable",
% d7 G9 z1 t* W' k; W9 H "options" => array("Disable", "Enable")),' A( F! G/ |" E# h( \
M, G( ]6 B D$ _0 v( ?& J array( "name" => "Insert Google Adsense Code For Loops Here<br />
4 X4 r8 ^- G# \4 r% u8 ]& C <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
, F( |0 @5 l0 p2 f" Z "id" => $shortname."_adsense_loop",8 l1 J( S9 H0 j: l& G* `
"type" => "textarea",0 B. q2 Y; v2 [4 E: i; I
"std" => "",
! B/ h/ P6 }4 r+ O& T7 w ),
+ o7 B5 A6 l& u- `. N8 c4 s3 O/ J
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",2 [3 \. W5 c" j; Z) w: P
"id" => $shortname."_adsense_single_activate",, t9 x t) v S( y% v
"type" => "select",
9 |$ Z" Z9 o) z* D' j "std" => "Disable",- w2 H: ~; E, w
"options" => array("Disable", "Enable")),
, D0 ~7 c* B8 \ z, Q3 l8 v X( F, p5 l% V( d. K
array( "name" => "Insert Google Adsense Code For Single Page Here<br />6 ]" e% b6 {* o% y7 S5 ?1 w8 Y
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
+ x \# }5 h- Z/ s, M) B4 { "id" => $shortname."_adsense_single",0 e7 }& g K4 x+ O
"type" => "textarea",
/ @8 H O& S. k k' T/ G "std" => "",
9 F7 q/ V4 l- H7 m! F0 A; ~! d' q ),2 o: j% {* r- }9 K- R
7 M( b# Q( P! h9 X4 B, ]
( z: I) `# D$ `6 e array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",2 h+ q4 B# Z4 u
"id" => $shortname."_google_analytics"," R9 c2 p4 j9 e, E
"type" => "textarea",4 k6 A- [2 g4 w W: H8 A+ h
"std" => "",2 d6 F' |3 L& T# C* x
),
% c. f/ e3 K3 o% I5 g( W/ x- [. x
$ I0 Q6 A4 p \* J* J7 G+ o8 B* s# H array( "name" => "</div></div>", y( v! T/ T0 _$ N& z- B, B4 S* q& B
"type" => "close",! w- M; N/ _4 q- O+ n9 k# u* o/ Y
),
8 S0 ^& P G# l" s* P, `- ~ T* i( D) v7 G% ?8 L
6 Q6 \: }$ X" f; f/ Z4 B; Y% a
array( "name" => "AddThis Social Bookmarking Settings",! {+ Y, K( j5 g! e0 F2 N
"type" => "heading",* k+ u$ B& P' q# a
),
$ }/ F$ r9 M, E t$ u- N
5 U& j4 w' @/ i0 l2 R5 e3 e array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
7 M. s8 s q8 W9 ]4 c <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
) u, c1 S4 \5 ^" l* z "id" => $shortname."_addthis",
3 @2 ]4 z! w. O' v. N; z "type" => "text",
1 K7 {; y" y# l "box" => "social",4 Z( Z+ N* P0 w8 k0 p$ f
"std" => "",. D+ E: L7 G0 h* T2 k/ n- i2 B8 `
),7 X% K; e9 s, N* m
+ z: i7 w/ O/ i. J: f: w
array( "name" => "</div></div>",
3 d8 |& F- E7 w( e- J "type" => "close",
% X/ t3 I1 \ U' Z4 a* G5 K ),
- t- P( X8 Z# X" Y . x7 l1 l; y! y$ g6 ~
* f# R" E! v' e$ C* y D5 R5 _7 b
! q; ]6 T' X9 P% }
array( "name" => "YouTube Video Settings",
" V3 Q; U7 E$ a7 W8 Q" P2 o, _4 n "type" => "heading",9 V; u9 a" ^& z4 v! F
),
2 K9 e% Q- z- x: Q6 o" P: S# Z$ K h; v: `9 r
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",4 |: d+ R; ^, ^. E4 k
"id" => $shortname."_emvideo_activate",* {% Y7 C; ^1 F$ b4 g
"type" => "select",+ d4 A2 B5 b L' P1 J I
"std" => "No",
7 [7 Y7 ?* y. w6 s1 @" o# U, g8 t "options" => array("No", "Yes")),
0 H& t: V# r& k- X: R( W4 p
. _6 Z0 e- O9 Q6 G8 h8 }2 t: N M 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>",
& T- y ?7 O# A5 P, Y" w4 W. K "id" => $shortname."_emvideo",8 W7 M( \5 ~! r; e/ B8 O
"std" => "",
& }$ _; Y, R8 P* Y5 H "type" => "text"), s1 g/ Q) s+ ~6 e
! ]! ]& q) n' a; g" X# L array( "name" => "</div></div>",; h9 J1 [ o& W
"type" => "close",. T1 [+ M* A, J- E
),
9 y/ V U6 u9 e8 L
$ |) c/ m; f/ `2 _& n array( "name" => "Twitter Settings",- ?7 W2 Q$ F/ `# {- L
"type" => "heading",
1 Q. c3 f) |% d! z! Z$ h ),. d* x E# s! I5 g: _# b( k7 a1 P8 j
) D0 y$ i7 x& L- S4 w
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",8 U0 V' o. k1 j G% G
"id" => $shortname."_twitter_activate",8 t0 j, p/ a! _& f; {/ p0 g4 Q
"type" => "select",
3 L6 l* }. f L3 j. @' v6 o3 z" d4 w "std" => "No",
+ W2 b6 I9 H" `0 s "options" => array("No", "Yes")),
3 f" F" ~( P" S2 Y: q y
3 R3 r$ W; e) N2 R- O array( "name" => "Insert Your Twitter ID here' F* _: P4 E6 f1 m2 q
<br /><em>*leave blank if not necessary</em>0 j) z7 I* {5 y+ z* q6 @
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",3 p c) s5 B4 k" i3 ?$ \
"id" => $shortname."_twitter",, g3 Y, k7 X; n9 O4 }
"type" => "text",& i7 L. h1 @/ u' y) y0 J4 i
"box" => "social",
8 m* m8 V% d: z "std" => "",
! j: y5 f( r+ L# K/ O ),* r2 A4 t% O& Y8 {
8 G6 g% l, M6 ]: y- e array( "name" => "Enter Twitter Feed Count here+ d5 s. M, S% A( V0 M# z
<br /><em>*leave blank if not necessary</em>' v* G, F+ Y0 f
<br /><em>*Enter How Many Twitter Feed To Display</em>",
7 I9 b; q5 X6 | "id" => $shortname."_twitter_count",7 T5 X! a6 W' X4 Z: T
"type" => "text",
0 c0 Y" t8 J/ L5 s "box" => "social",$ { M& q9 Z W# b' x
"std" => "",3 I! d9 [+ h" }9 p% x" S! P
),/ @% j" \1 w) S) ~
. x1 U& N5 a$ B+ ]
array( "name" => "</div></div>",% O; {& p/ N2 ]6 B
"type" => "close",% m( z/ l) Y, N. ?
),/ l" _# V4 U1 j9 I9 L
5 H5 @# E" L, ]( j2 M; [8 l. A
# r& m; I: Q+ d; E4 t& ~ Z( @& z array( "name" => "125 x 125 Banners Advertisement Settings",& y. T# E$ |5 T
"type" => "heading",5 u4 N7 `- y) v0 n# ~0 W
),3 Z$ | b2 ] r+ t) r
2 M( e9 k6 L3 l" D
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>"," `+ ~2 t4 f+ E& U, B3 e
"id" => $shortname."_sponsor_activate",
3 ?4 K% c* \: J( P) B3 i2 n0 K "type" => "select",9 h* K4 o5 I c
"std" => "No",6 @& q" b% R1 L: Z6 I/ U/ M1 y
"options" => array("No", "Yes")),
1 i, f1 @& T( {7 _: ?0 d4 j( j
6 v' _% `$ R4 U. [; z+ w. y" w: I* U: ^# X# L5 g: a& v& I* S% f. G0 k
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
) S1 a+ w! D. ^2 Y "id" => $shortname."_sponsor_banner_one",; s" J3 j# A( B4 D# o; a1 H1 @
"type" => "textarea",
3 \6 ]% J9 ^: M, d" v& E "std" => "", p3 j& @$ _# S% J9 a2 [' o
),
9 V# Z1 u* S6 D k8 _8 S1 G0 H; ^. B% p; h
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",3 F7 v7 ?! I$ t: F* V$ ^
"id" => $shortname."_sponsor_banner_two",
5 J l7 f* I: w "type" => "textarea",
8 h: B4 n6 T* F1 _% t# c "std" => "",
5 ^$ ?+ J) X5 s, j1 y- ~7 w ),6 |$ X; [& L3 V( ]: {: y" x8 X x
6 q+ S [$ r6 I9 v5 v
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>"," g. p! F9 j% C: [4 X
"id" => $shortname."_sponsor_banner_three",
+ o: I* K! _6 D3 _* Z, I "type" => "textarea",& r6 F7 t" E7 J, j( r( P
"std" => "",8 }: E5 ~4 t8 U/ v; U; Z9 H
),
k' m4 ]- O: `% S6 [/ s; x0 ^" E, w' i8 ^7 b- U0 @) L( f3 f0 M
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
+ N2 B# J" K) |# M6 I- O "id" => $shortname."_sponsor_banner_four",! K: w9 ]" D6 V9 X$ D+ j* ?
"type" => "textarea",) G! x) @% i3 N+ J
"std" => "",
# w f7 g$ f1 \! n S. _ ),
9 s, Z; G# a; z* d8 K6 B8 s+ F' K5 n$ R* q) W7 J
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
4 ]' G1 m: @7 Y9 y "id" => $shortname."_sponsor_banner_five",
9 u1 y& R; p1 k" Q, ~ "type" => "textarea",6 t) c8 ^$ i* {. n, c" Y
"std" => "",& M+ ]3 v/ c- k8 ?
),
! f$ R6 o; m: e; U0 L. Z1 R' b: ?: X* q/ {/ y$ E0 A1 @) C9 h
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
{; I8 p6 S$ `) Z0 @) h "id" => $shortname."_sponsor_banner_six",3 u4 i7 z C+ k, W0 s0 v+ X8 [7 ]
"type" => "textarea",
. J0 t( o( h- n "std" => "",9 U/ K, g' N7 i* W
),
: c3 V, Y) {2 o- Z1 b7 c$ L. y5 B! Z9 A) ]
array( "name" => "</div></div>",
; N9 v$ l: Q: L" q "type" => "close",
- ^5 n3 S2 h& ^" }8 k) [$ B# G ),1 v# R# P5 P) M* P
( I: H' g8 D- J' ?5 k7 @
+ D+ r6 ?; o+ P! j
0 M$ m" k6 t) |) f# A);
7 O' Y% j& w3 `. ?4 C' i/ w/ V9 {- ~" ~" H& F5 l7 R# n7 o
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
! F8 b. C) D. P7 R4 T
" W7 w$ m4 M$ w! M& [echo "<div id=\"admin-options\"> ";
7 P$ Y4 I! D: O. K* M/ t2 C1 W; J R) o4 K- u" a5 X. i+ w
global $themename, $shortname, $options;
7 \) u, C9 V9 o, sif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';/ o2 {( j6 M: g# p
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';2 t& R: S- R0 ~# w, p6 s4 s
?>
$ ~" U+ G; m( w% z5 }, k! h
) {2 Q R: |2 W- i6 c<h4><?php echo "$themename"; ?> Theme Options</h4>
7 Q! H" R: \* B* h/ U+ ^5 x; r9 |8 a0 j5 ~& ^8 z
<div class="annouce">4 e2 l, Q' ~8 R7 N0 w4 g5 P7 J
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
F8 a+ x( _+ }$ K; b<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>+ {, o& j0 m& m; h2 `% m) p& r; N
</div>
$ J/ @3 ^+ d4 g( {8 d" @% m5 k3 S$ n1 ^& ]+ e
<form action="" method="post">
% m- Q- a, O2 h- f
6 C, S G$ E9 o% }/ D<?php foreach ($options as $value) { ?>
5 s* J5 T! s3 s6 O6 s: E# l. V [; o/ e
<?php switch ( $value['type'] ) { case 'heading': ?>2 ]' k& A: N) S6 T# D. {4 v# Z: T
+ t1 ]" h3 {: y7 f( g7 r: Z. n6 g# Q<div class="get-option">
( n: y7 c) g$ O1 b) p3 {$ Q T S) e) F9 Q$ c% f+ d1 E' f
<h2><?php echo $value['name']; ?></h2>$ O: L) j" Q! S t7 ? a3 E4 K
2 Y% L- K; o& L" Y# j& w& Z; S, d/ \<div class="option-save">
( v. K6 t9 E a& R5 L7 Z( W& |- o# ]
<?php
. `3 ]4 G* O; I0 Q) @break;
3 X% V1 z) C# O5 {5 I# o+ @4 lcase 'text':7 e+ H P3 U: A4 E7 {+ q: D
?>( N! m9 T, y0 H: q; ~, E3 R
" l6 }9 X; f( M<div class="description"><?php echo $value['name']; ?></div>$ e5 n( n0 x: W- d* G- O1 B: T
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (6 s7 N9 G, X5 t, D0 _
" _" i" s3 V; `' C& L# iget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>& T6 K* d/ A( C- f4 O+ G) b
/ G5 N+ w4 Z0 C3 m. U% R4 k<?php
9 a3 ~% Q% w& W1 U! M5 H" zbreak;0 T( N1 R! G" ^: ]; S: X
case 'select':
; n7 a- g" Z, a! A, N: L?>
+ w# r- v* c. _ U" r4 V1 Y
- d& x1 `( i# t! @5 j<div class="description"><?php echo $value['name']; ?></div> |) {( E9 h: V1 R% N/ O- t
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">1 a( w* k; q6 B, a9 T: k% g# {
<?php foreach ($value['options'] as $option) { ?>
/ n l4 M% [* k5 N) ^4 u. s* K<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>, B$ a& v" M$ \: A* l. b
<?php } ?>
* P1 W; o0 U% D3 A</select>
+ ?! ?4 O* h& p- d</p>
" ?) I* }4 A' V6 T6 Q, R) t4 n1 y8 V5 x5 y& S7 o
<?php6 Y0 U% x" ]! D% u* B* P# Z8 e; S2 h
break;
" k) q% O4 j# n& k; R) B9 Dcase 'textarea':7 J: Y# e' ]- n8 X
$valuex = $value['id'];8 l/ \. Q% K5 L4 }+ l* [
$valuey = stripslashes($valuex);
1 h" E! d* ]% w6 e. J4 S$video_code = get_settings($valuey);
# m6 ?% Z9 x9 o?>8 i3 d- h( y0 `; l1 `9 R
+ F. e! ^- E. T$ @. |; N<div class="description"><?php echo $value['name']; ?></div>
8 }( a$ l: r' G3 N8 k' W<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
4 b6 x" [# N$ x0 _. p+ F v
4 D7 {! z, l" a& X* B; Q. gelse { echo $value['std']; } ?></textarea></p>+ o" F$ R# v9 i1 G
4 ^* j- S2 n7 o+ {<?php. z! a/ h$ x& ^
break;3 i$ E4 M8 e# u8 z# W( Z1 t
case 'close':
% f+ w, C, t& l9 a?>
2 I" e2 Q/ Z' c) g4 B- C0 |" X: _# O& r! h
<div class="clearfix"></div>
5 P6 Y( ]% f. q4 P1 ?1 X</div><!-- OPTION SAVE END -->: q- R7 r' ~$ A2 v8 {( G- A. A
6 a( L7 E/ y+ s. u4 z
<div class="clearfix"></div>
/ W6 s$ J, X1 L# w: t</div><!-- GET OPTION END -->
. B6 L3 ~2 A4 y% z
2 d$ s" f* f' u+ }% n& N<?php. Z0 s0 @5 Y4 u
break;3 }% h; C$ G7 @8 K7 {0 ~5 l
default;% v# q) q4 d; h- d( P! O
?>
; a! l5 T' Q3 T% u- L
; b. [2 q+ V1 y! t7 e- X
" t2 i; Y/ N& q<?php
7 k* A g, C+ a# ]% ~break; } ?>
' T5 C" _3 W0 D0 ^
; g( I; s( P! f. t0 L<?php } ?>
* `6 r/ i" ?* p# J, a. ]+ B2 q) Z6 M" G$ O4 e X E, _4 B
<p class="save-p">
, o' u9 u- m, H! a+ x# f<input name="save" type="submit" class="sbutton" value="Save Options" />; {8 A1 }* d& S3 `
<input type="hidden" name="action" value="save" />
$ Q# z2 A# \/ T9 S6 Z7 j</p>
) H& u& U, `$ L4 I5 c e" I</form>
+ V$ e/ K D2 X1 K9 i; P# j, t" O ?: t- m2 m6 R7 k
<form method="post">
- x( p8 ?1 e% j1 H m( a0 J<p class="save-p">
% L7 I$ E4 i! [4 k+ ?<input name="reset" type="submit" class="sbutton" value="Reset Options" />
/ @; ]1 o: F+ r# d% a* b) M4 M<input type="hidden" name="action" value="reset" />
1 O" {1 F+ ]5 l1 {1 d3 u</p># |6 i* w" R1 n; G3 o* w. g: F
</form>
/ F5 V/ z: m% R* s
% H9 _* z+ l W3 |</div><!-- ADMIN OPTIONS END -->0 J0 g% n; V# X; \" e% d, _8 @ V' e
, A0 g# I) @2 w2 S; A<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }; s( E$ H& \4 ?: _( c
9 K6 E2 _, o- c& v! h d: n
function mytheme_admin_register() {
; P9 S' ]" }- d4 b1 _* r' }global $themename, $shortname, $options;* Q" Z, p1 Y7 G
if ( $_GET['page'] == basename(__FILE__) ) {* x. {. K5 I5 q2 _5 C
if ( 'save' == $_REQUEST['action'] ) {
5 n# v! r R+ X& o G4 iforeach ($options as $value) {
# _' y+ s X, _- |% Lupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
6 h: S$ n! Y$ I9 o' c+ Qforeach ($options as $value) {
+ M# b7 v% _" T* lif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }3 A0 I' p% _/ d3 S' g: E4 k
header("Location: themes.php?page=functions.php&saved=true");
7 S1 V5 S7 g- a4 E0 F. \1 \0 Vdie;
& x. b+ a, F. Q} else if( 'reset' == $_REQUEST['action'] ) {$ v1 t0 y- O$ _2 S
foreach ($options as $value) {; P- m. B" E1 @7 _& i. M8 N
delete_option( $value['id'] ); }
; q4 U9 W# l5 Aheader("Location: themes.php?page=functions.php&reset=true");
4 Q0 B0 \( U! P0 hdie;
. t9 ]) v h$ `/ o! ^}! n7 J* R1 U* G& W1 U$ G& Z
}
* U2 N" M8 m. j# i1 M: }; ?2 ]9 ]add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');# G5 o8 D9 z- R# B4 [7 R
}7 A* ?/ Q/ @- F# F8 y: Z. m, s
5 n, V" M8 F8 k' t8 G5 u9 W: lfunction mytheme_admin_head() { ?># p" m: j+ B0 N1 ^, P7 c
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />- ?0 n1 C: j' R. K
<?php }
9 b- [1 P- c# i7 A( Q8 A" C8 @3 g |
|