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