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