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