|
|

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