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