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