|
|

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