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