|
|

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