|
|

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