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