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