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